【发布时间】:2018-06-01 10:19:13
【问题描述】:
我尝试使用 localhost 作为邮件服务器,但收到“454 4.7.0 TLS not available due to local problem”错误。
如何禁用邮件的 TLS?
我正在使用 Spring Boot。
【问题讨论】:
标签: spring ssl spring-boot jakarta-mail
我尝试使用 localhost 作为邮件服务器,但收到“454 4.7.0 TLS not available due to local problem”错误。
如何禁用邮件的 TLS?
我正在使用 Spring Boot。
【问题讨论】:
标签: spring ssl spring-boot jakarta-mail
mail.smtp.starttls.enable 和 mail.smtp.starttls.required 是 JavaMail 中定义的两个属性。但是,为了在 Spring 应用程序中使用它们,我们需要使用 Spring 中的“附加属性”方法将它们添加到应用程序属性中。相关摘自Spring Boot reference:
spring.mail.properties.*= # Additional JavaMail session properties.
因此,简而言之,我们需要在 application.properties 文件中添加以下内容,以便在 Spring 中使用不带 TLS 的邮件:
spring.mail.properties.mail.smtp.starttls.enable=false
spring.mail.properties.mail.smtp.starttls.required=false
【讨论】:
.enable 对我有用(但启动 1.5.5);无需添加.required 条目