报错内容如下,
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Wed Jul 27 16:51:55 CST 2022
There was an unexpected error (type=Internal Server Error, status=500).
Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 550 Mail content denied. http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726 [MAR6Fz7DAJ9JziTegX5muH4f4L7q3kqmYxa+eQT7/x0ckvf0gkVT+3BsJCZpza172A== IP: 159.226.181.127]
org.springframework.mail.MailSendException: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 550 Mail content denied. http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726 [MAR6Fz7DAJ9JziTegX5muH4f4L7q3kqmYxa+eQT7/x0ckvf0gkVT+3BsJCZpza172A== IP: 159.226.181.127]
; message exception details (1) are:
Failed message 1:
com.sun.mail.smtp.SMTPSendFailedException: 550 Mail content denied. http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726 [MAR6Fz7DAJ9JziTegX5muH4f4L7q3kqmYxa+eQT7/x0ckvf0gkVT+3BsJCZpza172A== IP: 159.226.181.127]
在application.properties中添加以下语句:
spring.mail.properties.mail.smtp.starttls.enable=false
spring.mail.properties.mail.smtp.starttls.required=false
成功显示如下
相关解释
mail.smtp.starttls.enable boolean 如果为true,则在发出任何登录命令之前,允许使用STARTTLS命令(如果服务器支持)将连接切换到TLS-protected 的连接。 如果服务器不支持STARTTLS,则在不使用TLS的情况下继续连接。如果不支持STARTTLS,请参阅mail.smtp.starttls.required属性失败。请注意,必须配置适当的信任库,以便客户端信任服务器的证书。 默认为false。mail.smtp.starttls.required boolean 如果为true,则要求使用STARTTLS命令。如果服务器不支持STARTTLS命令,或者该命令失败,则connect方法将失败。默认为false