赞
踩
这里采用的是163邮箱。
mail:
host: smtp.163.com
username: xxxxxxx@163.com
password: xxxxxxxxx
nickname: xxxxxx #别名
protocol: smtp
properties:
mail:
smtp:
port: 465
auth: true
ssl:
enable: true #开启ssl协议
在本地Windows环境下使用邮件功能没有问题,当项目打包到阿里云或腾讯云是就。发送不了
报如下错误:
错误一:Could not connect to SMTP host: smtp.163.com, port: 25
产生错误原因:25端口被阿里云和腾讯云禁用,需要申请开启。(不建议使用,一般不会通过)
解决方案:
修改端口为:465
错误二:No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
产生错误的原因:jdk1.8版本导致SSL调用权限上有问题。
解决方案:
找到jdk 1.8安装目录,找到/jdk/jdk1.8.0_291/jre/lib/security 下面有个java.security。找到对应的,注释掉,重启项目就好了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。