Springboot做项目部署发送邮件时,出现org.springframework.mail.MailAuthenticationException: Authentication failed; nested exception is javax.mail.AuthenticationFailedException: 535 问题
出现问题的代码:
pring.mail.host=smtp.sina.com
spring.mail.port=465
spring.mail.username=xxxx@sina.com
spring.mail.password=xxxxxxx
spring.mail.protocol=smtps
spring.mail.properties.mail.smtp.ssl.enable=ture
原因是:我的POP3/SMTP服务是开启的,但我在password处填写了邮箱的登录密码
当我把邮箱密码改为授权码后,错误解决。
但我第二次测试时,又出现了Couldn’t connect to host, port: smtp.sina.com, 465; timeout -1;这个错误,具体错误代码如下
org.springframework.mail.MailSendException: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.sina.com, 465; timeout -1;
nested exception is:
java.net.UnknownHostException: smtp.sina.com. Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.sina.com, 465; timeout -1;
nested exceptio