我正在查看cakephp電子郵件組件的第一次。我從我的本地主機發送電子郵件這樣的:無法使用gmail smtp從本地主機發送電子郵件?
$this->Email->smtpOptions = array( 'port'=>'465',
'timeout'=>'30',
'host'=>'smtp.gmail.com',
'username'=>'[email protected]',
'password'=>'mygmailpassword'
);
$this->Email->delivery = 'smtp';
$this->Email->from = "[email protected]";
$this->Email->to = "[email protected]";
$this->Email->subject = "Subject";
$this->Email->sendAs = 'html';
$this->Email->lineLength = 255;
$body = "<h1>This is body</h1>";
$this->Email->send($body);
它不發送任何電子郵件,甚至沒有表現出任何差錯。
有什麼遺漏嗎?
感謝
退房谷歌帳戶啓用? – Sergey