|
@@ -352,8 +352,13 @@ public class EmailUtil {
|
|
properties.put("mail.smtp.host", mailboxInfoDTO.getHost());
|
|
properties.put("mail.smtp.host", mailboxInfoDTO.getHost());
|
|
properties.put("mail.smtp.auth", true);
|
|
properties.put("mail.smtp.auth", true);
|
|
properties.setProperty("mail.smtp.port", mailboxInfoDTO.getPort());
|
|
properties.setProperty("mail.smtp.port", mailboxInfoDTO.getPort());
|
|
- properties.put("mail.smtp.ssl.enable", true);
|
|
|
|
- properties.put("mail.smtp.ssl.required", true);
|
|
|
|
|
|
+ if (mailboxInfoDTO.getCompetitionId() == null || mailboxInfoDTO.getCompetitionId() != 48) {
|
|
|
|
+ properties.put("mail.smtp.ssl.enable", false);
|
|
|
|
+ properties.put("mail.smtp.ssl.required", false);
|
|
|
|
+ } else {
|
|
|
|
+ properties.put("mail.smtp.ssl.enable", true);
|
|
|
|
+ properties.put("mail.smtp.ssl.required", true);
|
|
|
|
+ }
|
|
// 根据邮件的会话属性构造一个发送邮件的Session,
|
|
// 根据邮件的会话属性构造一个发送邮件的Session,
|
|
JakartaUserPassAuthenticator authenticator = new JakartaUserPassAuthenticator(mailboxInfoDTO.getAccount(), mailboxInfoDTO.getPassword());
|
|
JakartaUserPassAuthenticator authenticator = new JakartaUserPassAuthenticator(mailboxInfoDTO.getAccount(), mailboxInfoDTO.getPassword());
|
|
Session session = Session.getInstance(properties, authenticator);
|
|
Session session = Session.getInstance(properties, authenticator);
|