开发者

zend framework gmail

I'm trying to use zend mail for sending in one of my application.

I'm not sure what is the basic requirement for using zend_mail.

$this->开发者_开发技巧;transport = new Zend_Mail_Transport_Smtp(
        'smtp.gmail.com', 
        array(
            'ssl'=> 'tls',
            'port'=> '587',
            'auth'=> 'login', 
            'username'=> 'email@email.com', 
            'password'=> 'password'
    ));

Zend_Mail::setDefaultTransport($this->transport);

and while sending mail

$mail->send($this->transport);

and handled error using

$e->getCode().$e->getMessage(); 

script gives me error 05.5.2

I'm not able to understand what is the issue.


The port should be 465!!!! Then it works. By me as well!


Leave the port off:

$config = array('auth'=>'login', 'username'=>'', 'password'=>'', 'ssl'=>'tls');
$transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);
$mail->send($transport);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜