栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

AuthenticationFailedException: 535 Error: authentication failed解决方案

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

AuthenticationFailedException: 535 Error: authentication failed解决方案

JavaMail踩过的坑:

Caused by: javax.mail.AuthenticationFailedException: 535 Error: authentication failed
	at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:947)
	at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:858)
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:762)
	at javax.mail.Service.connect(Service.java:342)
	at org.springframework.mail.javamail.JavaMailSenderImpl.connectTransport(JavaMailSenderImpl.java:518)
	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:437)
	... 71 more

JavaMail发送邮件失败问题:
1,检查自己邮箱是否开通pop3/smtp服务。
2、配置文件中的邮箱密码是否为开通pop3/smtp服务时所给的授权码,注意不是账号密码。
3、spring.mail.host=smtp.163.com,这里的host不同的邮箱不一样,这个是网易的
4、spring.mail.properties.mail.smtp.ssl.enable=true,这里要设置位true
最后,以上都没问题,我遇到了一个大坑,被新浪邮箱坑惨了,邮件总是发送失败…快被整吐了的,最后换成网易邮箱一下就好了。具体也不知道什么原因(可能新浪给俺拉黑了)

下面是我的mail配置文件

#MailProperties
spring.mail.host=smtp.163.com
spring.mail.port=465
spring.mail.username=lesliehh920@163.com
spring.mail.password=YIMSGZZQUPDCLSYW
spring.mail.protocol=smtps
spring.mail.properties.mail.smtp.ssl.enable=true
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/694532.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号