2010-11-29 54 views
1

IM蛋糕的电子邮件组件电子邮件组件SMTP错误CakePHP的

[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'=>'********', 

    ); 

回答

1

您的姓名之前有一个空格,可能会发送错误的数据。您是否尝试过没有额外空间的代码?

1

那么,在谷歌的支持论坛错误消息中的链接说,用户名和密码组合是不正确的。我建议您尝试使用指定的密码登录到该gmail帐户,只是为了三重检查你没有错。这一直发生在我身上。

其次,你确定你应该把@ gmail.com作为用户名吗?也许它只是'name'而不是'[email protected]'。

1

除了@Travis所陈述的......我还建议from也应该以这种格式“Name”构建......否则我不认为电子邮件会通过。