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