2010-11-29 55 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」構建......否則我不認爲電子郵件會通過。