通过 Gmail smtp 服务器使用 Zend_Mail 发送邮件
我想使用 Gmail smtp 服务器通过 Zend_Mail 发送电子邮件。我有这段代码
Zend_Mail::setDefaultTransport(new Zend_Mail_Transport_Smtp("smtp.googlemail.com", array(
"auth" => "login",
"username" => "[email protected]",
"password" => "mypassword",
"ssl" => "ssl",
"port" => 465
)));
,但是当我尝试发送电子邮件时,它会抛出异常,并显示消息连接被拒绝。
我哪里错了?
I'd like to use Gmail smtp server to send email with Zend_Mail. I had this code
Zend_Mail::setDefaultTransport(new Zend_Mail_Transport_Smtp("smtp.googlemail.com", array(
"auth" => "login",
"username" => "[email protected]",
"password" => "mypassword",
"ssl" => "ssl",
"port" => 465
)));
but when I try to send an email it throws an Exception with message Connection refused.
Where I'm wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的参数是错误的。尝试一下这些:
Your params are wrong. Give it a shot with these: