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