使用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 = "[email protected]";
$this->Email->to = "[email protected]";
$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

你可能感兴趣的:(c,Scheme,email,Gmail,cakephp)