0
点赞
收藏
分享

微信扫一扫

云部署springboot项目邮件Could not connect to SMTP host: smtp.qq.com, port: 25错误

云部署springboot项目邮件Could not connect to SMTP host: smtp.qq.com, port: 25错误_spring boot

一:云服务器禁用25端口导致发邮件失败:Couldn't connect to host, port: smtp.example.com
有两种解决方法:
  1. 向云厂商申请解封25端口
  2. 改用465端口ssl加密发送。
465端口是为SMTPS(SMTP-over-SSL)协议服务开放的,这是SMTP协议基于SSL安全协议之上的一种变种协议,
它继承了SSL安全协议的非对称加密的高度安全可靠性,可防止邮件泄露。SMTPS和SMTP协议一样,也是用来发送邮件的,只是更安全些,
 

spring:
mail:
host: smtp.qq.com
username: xx@qq.com
password: xxx
properties:
mail:
smtp:
socketFactory:
class: javax.net.ssl.SSLSocketFactory
port: 465
ssl:
enable: true

default-encoding: utf-8
userRegisterSub: xx名称
userRegisterText: xxx名称
sendFrom: xxx@qq.com
port: 465

二:修改测试

云部署springboot项目邮件Could not connect to SMTP host: smtp.qq.com, port: 25错误_发邮件_02

 


举报

相关推荐

0 条评论