原因
原来是ECS基于安全考虑,禁用了端口25。改成465就可以发邮件了。

原始配置  本地可发送 
#spring.mail.host=smtp.qq.com
#spring.mail.username=qq
#spring.mail.password=password
#spring.mail.properties.mail.smtp.starttls.enable=true
#spring.mail.properties.mail.smtp.auth=true
#spring.mail.properties.mail.smtp.starttls.required=true
修改的配置 测试 部署到服务器上是可以发送的
spring.mail.host=smtp.qq.com
spring.mail.username=qq
spring.mail.password=password
spring.mail.default-encoding=UTF-8
spring.mail.port=465
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory

相关文章:

  • 2021-11-29
  • 2021-08-04
  • 2021-08-09
  • 2021-11-27
  • 2021-10-17
猜你喜欢
  • 2021-12-06
  • 2021-10-14
  • 2021-10-26
相关资源
相似解决方案