1.>在php.ini中打开对应的模块,然后在cakephp模板中创建布局
email/html/default.ctp
<html><body><?php echo $content_for_layout; ?></body></html>
email/text/default.ctp
<?php echo $content_for_layout; ?>
2.>然后在对应的controller中添加
var $components = array('Email');3.>在对应的控制器中添加
<?php
function sendNewMail()
{ $this->Email->smtpOptions = array
(
'port'=>'25',
'timeout'=>'30',
'host' => 'smtp.163.server',
'username'=>'<[email protected]>',
'password'=>'xxxxxx'
); $this->Email->delivery = 'smtp';
$this->Email->to = ‘<[email protected]>’;
$this->Email->subject = 'Welcome to our really cool thing';
$this->Email->template = 'email/html/default';
$this->Email->sendAs = 'both';
$this->Email->send('test the email');
}
?>没能发送成功
请问谁知道哪里出问题
email/html/default.ctp
<html><body><?php echo $content_for_layout; ?></body></html>
email/text/default.ctp
<?php echo $content_for_layout; ?>
2.>然后在对应的controller中添加
var $components = array('Email');3.>在对应的控制器中添加
<?php
function sendNewMail()
{ $this->Email->smtpOptions = array
(
'port'=>'25',
'timeout'=>'30',
'host' => 'smtp.163.server',
'username'=>'<[email protected]>',
'password'=>'xxxxxx'
); $this->Email->delivery = 'smtp';
$this->Email->to = ‘<[email protected]>’;
$this->Email->subject = 'Welcome to our really cool thing';
$this->Email->template = 'email/html/default';
$this->Email->sendAs = 'both';
$this->Email->send('test the email');
}
?>没能发送成功
请问谁知道哪里出问题
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货