关键配置:
1:php php.ini中 extension=php_openssl.dll ,把;去掉
2:apache httpd.conf LoadModule ssl_module modules/mod_ssl.so 把#去掉
1:php php.ini中 extension=php_openssl.dll ,把;去掉
2:apache httpd.conf LoadModule ssl_module modules/mod_ssl.so 把#去掉
require_once 'Zend/Mail.php';
require_once 'Zend/Mail/Transport/Smtp.php';
$mail = new Zend_Mail();
$config = array('auth' => 'login',
'username' => '登陆的邮箱',
'password' => '密码',
'ssl' => 'ssl',
'port' => 465
);
$transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);
$mail = new Zend_Mail();
$mail->setBodyText('发送的邮件内容');
$mail->setFrom('XXX@gmail.com', 'XXXXXXr');
$mail->addTo('XXX@163.com', 'XXXXXX');
$mail->setSubject('邮件主题');
$mail->send($transport);