当前位置:   article > 正文

Authentication failed; nested exception is javax.mail.AuthenticationFailedException的解决办法_authentication failed; nested exception is javax.m

authentication failed; nested exception is javax.mail.authenticationfailedex

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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

原因是:我的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
  • 1
  • 2
  • 3
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/1002931
推荐阅读
相关标签
  

闽ICP备14008679号