Email 电子邮件组件smtp错误cakephp

Email 电子邮件组件smtp错误cakephp,email,cakephp,components,smtp,Email,Cakephp,Components,Smtp,我在用cake的电子邮件组件发送电子邮件时遇到此错误 [smtpError] => 535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 r11sm77490vbx.11 有什么想法吗?这是我的密码 $this->Email->to = array(' juan <name@gmail.com>'); $this->Email->from = 'name@gmail

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

[smtpError] => 535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 r11sm77490vbx.11
有什么想法吗?这是我的密码

 $this->Email->to = array(' juan <name@gmail.com>'); 
 $this->Email->from = 'name@gmail.com';
    $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'=>'name@gmail.com',
        'password'=>'********',

   );
$this->Email->to=array('juan');
$this->Email->fromname@gmail.com';
$this->Email->subject='欢迎来到我们真正酷的东西';
$this->Email->template='simple_message';
$this->Email->sendAs='both';
$this->Email->smtpOptions=array(
“端口”=>“465”,
“超时”=>“30”,
“auth”=>正确,
'主机'=>'ssl://smtp.gmail.com',
'用户名'=>'name@gmail.com',
“密码”=>“*******”,
);

您的姓名前有一个空格,可能发送了错误的数据。您是否在没有额外空间的情况下尝试了该代码?

嗯,谷歌支持论坛的错误消息中的链接表明用户名和密码组合不正确。我建议您尝试使用指定的密码登录到gmail帐户,只是为了再次检查您是否错了。这种事经常发生在我身上


第二,你确定要在@gmail.com中输入用户名吗?也许应该是“名字”而不是“名字”name@gmail.com“.

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