cakephp 电子邮件组件不起作用
当我在 tmp 中签入调试和错误日志时,什么也没有 我尝试搜索相同的问题并关注它们,但不起作用
function sendNewUserMail($id) {
$User = $this->Member->read(null,$id);
$this->Email->smtpOptions = array(
'port'=>'465',
'timeout'=>'30',
'host' => 'ssl://smtp.gmail.com',
'username'=>'*******@gmail.com',
'password'=>'*******',
);
$this->Email->delivery = 'smtp';
$this->set('smtp_errors',$this->Email->smtpError);
$this->Email->to = $User['Myprofile']['email'];
$this->Email->subject = 'WelCome To Alltweak.com Just Fun to create and share new registry script';
$this->Email->replyTo = '[email protected]';
$this->Email->from = 'T@QM@N<[email protected]>';
$this->Email->template = 'simple_message'; // note no '.ctp'
$this->Email->sendAs = 'html'; // because we like to send pretty mail
$this->set('Member', $User);
$this->Email->_debug = true;
if ( $this->Email->send('Test Email') ) {
$this->Session->setFlash('Simple email sent');
} else {
$this->Session->setFlash('Simple email not sent');
}
}
When i check in debug and error log in tmp not anything
i try to search the same question and follow them but doesn't work
function sendNewUserMail($id) {
$User = $this->Member->read(null,$id);
$this->Email->smtpOptions = array(
'port'=>'465',
'timeout'=>'30',
'host' => 'ssl://smtp.gmail.com',
'username'=>'*******@gmail.com',
'password'=>'*******',
);
$this->Email->delivery = 'smtp';
$this->set('smtp_errors',$this->Email->smtpError);
$this->Email->to = $User['Myprofile']['email'];
$this->Email->subject = 'WelCome To Alltweak.com Just Fun to create and share new registry script';
$this->Email->replyTo = '[email protected]';
$this->Email->from = 'T@QM@N<[email protected]>';
$this->Email->template = 'simple_message'; // note no '.ctp'
$this->Email->sendAs = 'html'; // because we like to send pretty mail
$this->set('Member', $User);
$this->Email->_debug = true;
if ( $this->Email->send('Test Email') ) {
$this->Session->setFlash('Simple email sent');
} else {
$this->Session->setFlash('Simple email not sent');
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看本教程 ..我认为这个功能与你的功能类似。
祝你好运!
Take a look of this tutorial.. I think this functions are similar with your functions.
Good Luck!