您的位置:首页 > 编程语言 > PHP开发

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

2011-10-18 14:17 721 查看
$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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: