这是我在我的控制器中的cakephp方法中的代码,但没有任何电子邮件即将到账。我真的需要帮助。CakeEmail不能正常工作
当我打印$cc
变量,它给人阵列的输出,但不知道怎么知道邮件是否已成功或不发送。
由于没有邮件来到mailaccount,所以我猜邮件是不正确森德,或者出现在我的代码一些bug。
$email = new CakeEmail('default');
$body = "<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
</head>
<body>
<div style='background: #F6F6F6; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; margin: 0; padding: 0;'>
<table cellspacing='0' cellpadding='0' border='0' height='100%' width='100%'>
<tr>
<td align='center' valign='top' style='padding: 20px 0 20px 0'>
<table bgcolor='FFFFFF' cellspacing='0' cellpadding='10' border='0' width='624' style='border:1px solid #E0E0E0;'>
<tr>
<td width='147' align='center'><img src='".Router::url('/', true)."images/logo.png'></td>
</tr>
<tr bgcolor='#666666'>
<td colspan='2' align='center'>
Forgot Password
</td>
</tr>
<tr bgcolor='#CCCCCC'>
<td colspan='2'>Hello Admin, </td>
</tr>
<tr bgcolor='#E7E6EC'>
<td> </td>
<td width='415'>Your new password : ".$new_password."</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>";
$email->from(array($adminemail =>"Cakeshop"));
$email->emailFormat('both');
//$email->to($check['AdminLogin']['admin_email_address']);
$email->to(array($adminemail));
$email->subject('Recover Password');
$cc=$email->send($body);
请尝试的var_dump($ CC)和检查邮件发送状态,它会返回的布尔 –
它返回的数据 – soumikwebdeveloper
阵列共享你的回报输出数组。 –