@ -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 {