Commit 76e40a50 by yangll

发送邮件时 适配发送人为多个的情况

1 parent 852fe73c
......@@ -88,7 +88,11 @@ public class MailService {
* @param subject 主题
*/
public void sendSimpleMailOnlyContent(String to, String subject, String content) {
mailUtils.sendTextMail(to, subject, content);
//以逗号切割 兼容收件人为多个的情况
String[] split = to.split(",");
for (String toOne : split) {
mailUtils.sendTextMail(toOne, subject, content);
}
MessageLog log = new MessageLog();
log.setSubject(subject);
......
......@@ -91,7 +91,7 @@ public class NotifyApplicationTests {
@Test
public void testMailOnlyContent() throws Exception {
mailService.sendSimpleMailOnlyContent("592761523@qq.com", "notifycenter test" + DateUtils.format(new Date()), "杨林龙测试");
mailService.sendSimpleMailOnlyContent("592761523@qq.com,yangll@didihu.com.cn", "notifycenter test" + DateUtils.format(new Date()), "杨林龙测试");
Thread.sleep(30000);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!