授权码什么的问题我就不说了,因为那个属于配置问题。
这个问题主要出现在我想要多次连接然后测试的情况下,才会报535error
Caused by: javax.mail.AuthenticationFailedException: 535 Error: ÇëʹÓÃÊÚȨÂëµÇ¼¡£ÏêÇéÇë¿´: http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=28&&no=1001256
at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:965) ~[javax.mail-1.6.2.jar:1.6.2]
at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:876) ~[javax.mail-1.6.2.jar:1.6.2]
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:780) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.Service.connect(Service.java:366) ~[javax.mail-1.6.2.jar:1.6.2]
at org.springframework.mail.javamail.JavaMailSenderImpl.connectTransport(JavaMailSenderImpl.java:517) ~[spring-context-support-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.mail.javamail.JavaMailSenderImpl.testConnection(JavaMailSenderImpl.java:397) ~[spring-context-support-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.boot.autoconfigure.mail.MailSenderValidatorAutoConfiguration.validateConnection(MailSenderValidatorAutoConfiguration.java:52) ~[spring-boot-autoconfigure-2.1.4.RELEASE.jar:2.1.4.RELEASE]
... 30 common frames omitted
报这个错误,然后又发现自己什么配置都对的,尤其是“刚才还好好的,忽然不行了”,最简单的解决方法是等,没开玩笑,等一会就好了,看了https://stackoverflow.com/questions/17970343/javax-mail-authenticationfailedexception-535-authentication-failed-5-7-1这个解释,感觉和session登录超时也有一定的关系,不过我个人觉得关系不大= =感觉像是QQ邮箱在登录时校验的规则有些严格= =。
这两天在试各种邮箱的发送邮件功能整合在工程中,163 126会554 QQ会535= =如果有什么不用太操心邮箱服务器,请一定要告诉我= =谢谢,准备注册下sina邮箱试试看= =