修改邮箱配置

pull/1/head
liushaodong 5 years ago
parent b10db5a75b
commit 719ca97680
  1. 17
      blockchain-server/blockchain-server-user/src/main/java/com/blockchain/server/user/common/utils/EMailTransmitHelper.java
  2. 10
      spring-cloud/spring-cloud-config/src/main/resources/properties/emailconf-dev.yml

@ -39,6 +39,7 @@ public class EMailTransmitHelper {
private String hostName;//smtp服务器
private String userName;//发件人姓名
private String authCode;//授权码、密码
private String port;//端口号
private int timeout = 30;//超时时间,分钟
private boolean closed;
@Autowired
@ -53,10 +54,10 @@ public class EMailTransmitHelper {
}
Properties props = new Properties();
props.put("mail.smtp.host", hostName);
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.port", port);
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");
props.put("mail.smtp.port", port);
Session session = Session.getDefaultInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
@ -84,9 +85,9 @@ public class EMailTransmitHelper {
* 邮箱主题
*/
private enum Subject {
ZH_CN("【FLAMEX】安全验证"),
ZH_HK("【FLAMEX】安全驗證"),
EN_US("【FLAMEX】Safety Verification");
ZH_CN("【ZHIXINCHAIN】安全验证"),
ZH_HK("【ZHIXINCHAIN】安全驗證"),
EN_US("【ZHIXINCHAIN】Safety Verification");
private static Map<String, Subject> map = new HashMap<>();
static {
@ -111,9 +112,9 @@ public class EMailTransmitHelper {
* 邮箱主题
*/
private enum Msg {
ZH_CN("您好: \n【FLAMEX】本次安全验证为: {0} ,验证码仅用于FLAMEX官网,如非本人操作,请忽略!"),
ZH_HK("您好: \n【FLAMEX】本次安全驗證為: {0} ,驗證碼僅用於FLAMEX官網,如非本人操作,請忽略!"),
EN_US("Dear: \n【FLAMEX】your verification code is: {0} ,The verification code is only used for FLAMEX official website. If you do not operate the code, please ignore it!");
ZH_CN("您好: \n【ZHIXINCHAIN】本次安全验证为: {0} ,验证码仅用于智信链官网,如非本人操作,请忽略!"),
ZH_HK("您好: \n【ZHIXINCHAIN】本次安全驗證為: {0} ,驗證碼僅用於智信鏈官網,如非本人操作,請忽略!"),
EN_US("Dear: \n【ZHIXINCHAIN】your verification code is: {0} ,The verification code is only used for ZHIXINCHAIN official website. If you do not operate the code, please ignore it!");
private static Map<String, Msg> map = new HashMap<>();
static {

@ -1,13 +1,15 @@
#邮件发送方的email
email:
fromAccount: zhixinchain@163.com
#主机名 126邮箱为smtp.126.com,163邮箱为163.smtp.com,QQ为smtp.qq.com
hostName: 163.smtp.com
#主机名 126邮箱为smtp.126.com,163邮箱为smtp.163.com,QQ为smtp.qq.com
hostName: smtp.163.com
#邮件发送方的授权码
authCode: zhixinlian1112
#邮件发送方的用户名
userName: ZHIXINLIAN
userName: ZHIXINCHAIN
#过期时间,单位:分钟,默认30分钟
timeout: 30
#是否关闭邮箱 关闭(true) | 开启(false)
closed: false
closed: false
#端口号,这个是163使用到的;QQ的应该是465或者875
port: 465
Loading…
Cancel
Save