4
我想在Zend框架中使用gmail帐户发送电子邮件。这是我走到这一步:在Zend框架中使用gmail发送电子邮件
$mailTransport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', array(
'auth' => 'login',
'username' => '[email protected]',
'password' => 'password',
'port' => '587',
'ssl' => 'tls',
));
Zend_Mail::setDefaultTransport($mailTransport);
$mail = new Zend_Mail();
$mail->setBodyText('This is the text of the mail.');
$mail->setFrom('[email protected]', 'sender');
$mail->addTo('[email protected]', 'receiver');
$mail->setSubject('TestSubject');
$mail->send();
有了这个代码,我得到以下错误:
Message: Unable to connect via TLS
我怎样才能解决呢?我有一个默认的XAMPP安装设置,在php.ini中没有SMTP设置。
可能重复http://stackoverflow.com/questions/1094137/zend-mail-gmail-smtp – Rikesh 2012-07-19 13:13:10