暂时先这样,需要搁平台的key和secret

This commit is contained in:
2025-07-23 11:58:24 +08:00
parent 30cb6e3bfc
commit d6d75302f5
5 changed files with 40 additions and 108 deletions

View File

@@ -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());