Couldn't connect to host, port: smtp.qq.com, 25; timeout -1

匿名 (未验证) 提交于 2019-12-03 00:09:02

使用SpringBoot邮件任务发送邮箱报Couldn't connect to host, port: smtp.qq.com, 25; timeout -1错误

因为QQ邮箱默认端口为465

 

 需要在yml文件配置相应的邮箱端口

 1     mail:  2        port: 465  3        host: smtp.qq.com  4        username: @qq.com  5        password:   6        default-encoding: UTF-8  7        properties:  8          mail:  9             smtp: 10               auth: true 11               socketFactory:  12                  port: 465 13                  class: javax.net.ssl.SSLSocketFactory 14                  fallback: false 15               starttls: 16                  enable: true 17                  required: true
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!