springBoot 发送邮件

全局配置文件:

# JavaMailsender 邮件发送的配置

spring . mail .host-smtp.gg.com tsmtp.163. com

spring . mail .username=465008297@qq. com

spring .mail . password: xxxxxx #投权码

spring.mail. properties . mail . smtp . auth=true

spring .mail.properties .mail . smtp. starttls .enable=true

spring.mail.properties. . mail . smtp . starttls. required=true

●若使用ee邮箱发送邮件,则需要修改为spring . mail .host-smtp.gg.com.同时

spring .mail .password改为QQ邮箱的授权码。

I

#QQ邮箱->设置->账户->POP3/SMTP服务:开启服务后公获得QQ的投权码

出现认证失败的解决方案:因为JDKI.8中jre\lib\security中两个jar包替换的缘故。

将下载后的local. policy. jar和US_ export. policy. jar替换到JDK1. 8的

jre\lib\security文件夹即可。

你可能感兴趣的:(springBoot 发送邮件)