使用shopnc发送qq邮件遇到的坑

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_39307131/article/details/80401585

这两天使用shopnc框架发送邮件

经过测试  163邮箱可以发送成功  qq邮箱则发送不成功

经过我小伙伴们的研究发现存在这么个坑  

qq邮箱smtp.qq.com 需要ssl,而shopnc没有支持ssl

fsockopen($this->email_server, $this->email_port, $errno, $errstr, 30)

因此我们加上了以下判断

fsockopen($this->email_port=='25'?$this->email_server:'ssl://'.$this->email_server, $this->email_port, $errno, $errstr, 30)

经过测试终于可以成功发送啦 

遇到同样问题的小伙伴们不妨试试

猜你喜欢

转载自blog.csdn.net/qq_39307131/article/details/80401585