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


使用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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM