使用springboot
用qq邮箱的smtp服务发送邮件遇到这个错误
springboot Got bad greeting from SMTP host: smtp.qq.com, port: 465, response: [EOF]
解决方法:
如果使用端口为465
,将protocol的smtp
改为smtps
将配置文件端口改为587
,则可以使用smtp。
均为SSL连接端口,因为qq不支持非SSL端口。
以下是配置文件,重点在于protocal(视端口而定)和开启SSL(必须)
spring:
mail