-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
chengzi
committed
Jul 14, 2021
1 parent
2262b3b
commit 23dbfb8
Showing
2 changed files
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,8 +163,8 @@ public Object meiRiYiWen() { | |
model.put("items", items); | ||
Template template = freeMarkerConfig.getConfiguration().getTemplate("meiArticle.ftl"); | ||
String content = FreeMarkerTemplateUtils.processTemplateIntoString(template, model); | ||
mailSender.sendMultipartMailV2("[email protected]", subject, content); | ||
mailSender.sendMultipartMailV2("[email protected]", subject + "@每日一文", content); | ||
mailSender.sendMultipartMailV2("chengzi12130[email protected]", "chengzi12130@gmail.com", subject, content); | ||
mailSender.sendMultipartMailV2("[email protected]", "[email protected]", subject + "@每日一文", content); | ||
log.info("[[title={}]], spider send mail:{}", "meiRiYiWen", subject); | ||
return model; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,13 +96,13 @@ public void sendMultipartMail(String subject, String content) { | |
* @param subject mail subject | ||
* @param htmlString html string | ||
*/ | ||
public void sendMultipartMailV2(String email,String subject, String htmlString) { | ||
public void sendMultipartMailV2(String fromMail, String toEmail, String subject, String htmlString) { | ||
log.info("[[title={}]],subject:{}, start send mail", "sendMultipartMailV2", subject); | ||
try { | ||
Session session = Session.getDefaultInstance(new Properties(), null); | ||
Message msg = new MimeMessage(session); | ||
InternetAddress from = new InternetAddress("[email protected]", "daily article spider"); | ||
InternetAddress to = new InternetAddress(email, "daily favor article"); | ||
InternetAddress from = new InternetAddress(fromMail, "daily article spider"); | ||
InternetAddress to = new InternetAddress(toEmail, "daily favor article"); | ||
msg.setFrom(from); | ||
msg.addRecipient(Message.RecipientType.TO, to); | ||
msg.setSubject(subject); | ||
|