得到“javax.mail.AuthenticationFailedException:535-5.7.8用户名和密码不被接受”此错误

问题描述 投票:0回答:1

发送邮件时出错。即使application.properties中的确切属性在几个月前工作。

这是在application.properties中配置邮件发送的属性

mail.enable=true
spring.mail.host=smtp.gmail.com
[email protected]
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

[email protected]    

我该如何重新配置​​?我试着遵循特定的密码模式。不胜感激任何建议。

java spring-boot javamail
1个回答
0
投票

对于Gmail

spring.mail.host=smtp.gmail.com
spring.mail.port=587
[email protected]
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

© www.soinside.com 2019 - 2024. All rights reserved.