发送邮件时出现错误。尽管 application.properties 中的确切属性在几个月前就可以工作。
这是在application.properties中配置邮件发送的属性
mail.enable=true
spring.mail.host=smtp.gmail.com
spring.mail.username=abc@gmail.com
spring.mail.password=**************
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.socketFactory.port=465
mail.smtp.port=2525
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=false
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
spring.mail.properties.mail.smtp.socketFactory.fallback=false
support.email=abc@gmail.com
我该如何重新配置它?我尝试遵循特定的密码模式。将不胜感激任何建议。
最佳答案
对于 Gmail
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=example@gmail.com
spring.mail.password= Your Generated App Password (not your Gmail Account Password)
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
<小时/>
如何生成您的应用程序密码? Click Here
关于java - 收到 "javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted"此错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54967092/