电子邮件组件 smtp 错误 cakephp

发布于 2024-10-05 03:08:13 字数 1093 浏览 5 评论 0原文

我在使用 cake 的电子邮件组件发送电子邮件时收到此错误

[smtpError] => 535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 r11sm77490vbx.11

有什么想法吗?这是我的代码...

 $this->Email->to = array(' juan <[email protected]>'); 
 $this->Email->from = '[email protected]';
    $this->Email->subject = 'Welcome to our really cool thing';
    $this->Email->template = 'simple_message'; 

    $this->Email->sendAs = 'both'; 
  $this->Email->smtpOptions = array(
        'port'=>'465', 
        'timeout'=>'30',
  'auth' => true,
        'host' => 'ssl://smtp.gmail.com',
        'username'=>'[email protected]',
        'password'=>'********',

   );

im getting this error when sending emails with cake's email component

[smtpError] => 535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 r11sm77490vbx.11

any ideas? here's my code...

 $this->Email->to = array(' juan <[email protected]>'); 
 $this->Email->from = '[email protected]';
    $this->Email->subject = 'Welcome to our really cool thing';
    $this->Email->template = 'simple_message'; 

    $this->Email->sendAs = 'both'; 
  $this->Email->smtpOptions = array(
        'port'=>'465', 
        'timeout'=>'30',
  'auth' => true,
        'host' => 'ssl://smtp.gmail.com',
        'username'=>'[email protected]',
        'password'=>'********',

   );

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

滥情空心 2024-10-12 03:08:13

您的名字前面有一个空格,这可能会发送错误的数据。您是否尝试过没有多余空间的代码?

You have a space there before your name, which could possibly be sending the wrong data. Have you tried the code without that extra space?

就此别过 2024-10-12 03:08:13

好吧,错误消息中指向谷歌支持论坛的链接说用户名和密码组合不正确。我建议您尝试使用指定的密码登录该 Gmail 帐户,以便再次检查您是否有误。这种事经常发生在我身上。

其次,您确定应该将@gmail.com 作为用户名吗?也许它应该只是“名称”而不是“[电子邮件受保护]” 。

Well, the link in the error message to google's support forums say that the username and password combination are incorrect. I'd recommend that you try logging in to that gmail account with the specified password, just to triple check that you're not mistaken. That happens a lot to me, all the time.

Secondly, are you sure you're supposed to put the @gmail.com in for the username? Maybe it should just be 'name' rather than '[email protected]'.

寄人书 2024-10-12 03:08:13

除了@Travis 所说的之外......我还建议发件人也应该以“名称”这种格式构建......否则我认为电子邮件不会通过。

Apart from that stated by @Travis ... i would also suggest that the from should also be constructed in this format "Name " ... otherwise I don't think the email will go through.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文