|
@@ -33,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.mail.MessagingException;
|
|
|
+import javax.mail.Session;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
@@ -362,9 +363,10 @@ public class AgreementLogic {
|
|
|
//发送邮箱
|
|
|
|
|
|
//分发邮件
|
|
|
-
|
|
|
+ Session session = emailUtilsNew.loadMailSession();
|
|
|
for (String s : mailboxSendRecord.getReceiveMailbox().split(",|,")) {
|
|
|
- emailUtilsNew.send(s, mailbox.getSendMailbox(), "工伤险-" + mailboxSendRecord.getSendBatch() + "-" + mailbox.getSendName(), "你好,以下是" + DateUtil.format(new Date(), "yyyy-MM-dd")
|
|
|
+
|
|
|
+ emailUtilsNew.send(session,s, mailbox.getSendMailbox(), "工伤险-" + mailboxSendRecord.getSendBatch() + "-" + mailbox.getSendName(), "你好,以下是" + DateUtil.format(new Date(), "yyyy-MM-dd")
|
|
|
+ mailbox.getSendName() + "保险人员名单详情见附件", filePath);
|
|
|
}
|
|
|
|
|
@@ -413,9 +415,9 @@ public class AgreementLogic {
|
|
|
|
|
|
|
|
|
//分发邮件
|
|
|
-
|
|
|
+ Session session = emailUtilsNew.loadMailSession();
|
|
|
for (String s : mailboxSendRecord.getReceiveMailbox().split(",|,")) {
|
|
|
- emailUtilsNew.send(s, mailbox.getSendMailbox(), "雇主险-" + mailboxSendRecord.getSendBatch() + "-" + mailbox.getSendName(), "你好,以下是" + DateUtil.format(new Date(), "yyyy-MM-dd")
|
|
|
+ emailUtilsNew.send(session,s, mailbox.getSendMailbox(), "雇主险-" + mailboxSendRecord.getSendBatch() + "-" + mailbox.getSendName(), "你好,以下是" + DateUtil.format(new Date(), "yyyy-MM-dd")
|
|
|
+ mailbox.getSendName() + "保险人员名单详情见附件", filePath);
|
|
|
}
|
|
|
|
|
@@ -466,9 +468,9 @@ public class AgreementLogic {
|
|
|
|
|
|
|
|
|
//分发邮件
|
|
|
-
|
|
|
+ Session session = emailUtilsNew.loadMailSession();
|
|
|
for (String s : mailboxSendRecord.getReceiveMailbox().split(",|,")) {
|
|
|
- emailUtilsNew.send(s, mailbox.getSendMailbox(), "意外险-" + mailboxSendRecord.getSendBatch() + "-" + mailbox.getSendName(), "你好,以下是" + DateUtil.format(new Date(), "yyyy-MM-dd")
|
|
|
+ emailUtilsNew.send(session,s, mailbox.getSendMailbox(), "意外险-" + mailboxSendRecord.getSendBatch() + "-" + mailbox.getSendName(), "你好,以下是" + DateUtil.format(new Date(), "yyyy-MM-dd")
|
|
|
+ mailbox.getSendName() + "保险人员名单详情见附件", filePath);
|
|
|
}
|
|
|
|