专注于高品质PHP技术等信息服务于一体 [STIEMAP] [RSS]

百度提供的广告:
PHP
当前位置:首页 > 技术文档 > PHP >  > 
swiftmailer 发送邮件 出错
Connection could not be established with host smtp.qq.com [Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?

 $transport = Swift_SmtpTransport::newInstance('smtp.qq.com', 25 ,'ssl');

 第3个 参数  ssl 不传就使用默认的 25端口。

 针对 qq mail 来说, ssl  非ssl 都是可以发邮件的,为了简单些还是不用ssl 了。

 Expected response code 250 but got code "501", with message "501
 主要是 form: 写的发件人可能和 登录用户不一样,就会出现这个问题。

  $message->setFrom(array('admin@qingruxu.com' => 'qrx'));