springboot JavaMailSender ubantu系统不能正常发送邮件

解决代码如下:

# 发送邮件配置
spring.mail.host=smtp.qq.com
spring.mail.username=你的邮箱账号
spring.mail.password=你的邮箱授权码
spring.mail.default-encoding=UTF-8
spring.mail.socketFactoryClass=javax.net.ssl.SSLSocketFactory
spring.mail.debug=true
spring.mail.from=你的邮箱账号
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true
# SSL Config
spring.mail.port=465
spring.mail.protocol=smtp
spring.mail.properties.mail.smtp.ssl.enable=true
spring.mail.properties.mail.smtp.socketFactory.port=465
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory

你可能感兴趣的:(spring,boot,spring,java,JavaMailSender)