我正在查看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