使用CakePHP自带Email组件通过gmail发送邮件

$this->Email->smtpOptions = array(
'request' => array('uri' => array('scheme' => 'https')),
'port' => '465',
'host' => 'smtp.gmail.com',
'username' => '用户名',
'password' => '密码'
);

$this->Email->delivery = 'smtp';
$this->Email->from = "username@gmail.com";
$this->Email->to = "someone@foobar.com";
$this->Email->subject = "subject";
$this->Email->send("content"); 


参考:http://hi.baidu.com/thinkinginlamp/blog/item/ded3b901c204c409738da594.html

不行的话可以使用PHPMailer或者SwiftMailer。

其他资料:

http://thobian.info/?p=335

http://www.zhaokunyao.com/archives/980

http://planetcakephp.org/aggregator/items/2037-emailing-through-google-apps-gmail-on-cakephp

http://bakery.cakephp.org/articles/sky_l3ppard/2009/11/07/updated-swiftmailer-4-xx-component-with-attachments-and-plugins

阅读更多
个人分类: PHP研究
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭