记php升级到5.6及以上版本给phpmailer留的坑

没想到居然还能在php底下挂一篇,哦哈哈哈哈。但是这篇基本不会有什么要coding。

背景是发现https的网站上发邮件居然不管用了。报的最初错误是,无法连接到smtp服务器。

根据逻辑,先走telnet 和 证书验证查询,都没毛病(这里瞎举例一下口令

"telnet smtp.xx.com 777" and “echo QUIT | openssl s_client -connect smtp.xx.com:777"

)。端口对应加密方式,也没毛病ssl->465, tls->587,木有加密走25。但,就是发不出!

然后看到了下面这段话,老泪纵横。

"Starting from version 5.6, PHP always verifies certificate if TLS is used. Since a self-signed certificate is used on the server, the certificate verification by PHP gets failed. Certificate used to protect mail server does not correspond with the greeting message of Mail Transport Agent."
Directly quoted from https://support.plesk.com/hc/en-us/articles/115003022854--Troubleshooting-WordPress-Website-with-PHPMailer-or-SMTP-extension-cannot-send-mail-Failed-to-connect-to-server-0-SMTP-connect-failed

然后想说EASY xxx插件比WP SMTP Mail(这个插件就提示多算个优点吧)那个插件好。好吧,这个好一点的插件的名字,我也没记完整,总之有个EASY在里面。

EASY毕竟本地密码还有个加密选项,自我签发证书的验证有跳过选项。

最后的最后,提醒,其实邮件加密可以去wp-include/class-phpmailer.php里面hard code。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

取啥都被占用

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值