暂时先这样,需要搁平台的key和secret
This commit is contained in:
@@ -28,7 +28,12 @@ public class DynamicMailConfig {
|
||||
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
||||
|
||||
// 设置SMTP服务器
|
||||
mailSender.setHost(account.getSmtpHost());
|
||||
// 判断是否为网易企业邮箱(如 freeqiye.com)
|
||||
if (account.getEmail() != null && account.getEmail().toLowerCase().endsWith("@freeqiye.com")) {
|
||||
mailSender.setHost("smtp.qiye.163.com");
|
||||
} else {
|
||||
mailSender.setHost(account.getSmtpHost());
|
||||
}
|
||||
mailSender.setPort(account.getSmtpPort() == null ? 465 : account.getSmtpPort().intValue());
|
||||
mailSender.setUsername(account.getEmail());
|
||||
mailSender.setPassword(account.getPassword());
|
||||
|
||||
Reference in New Issue
Block a user