Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
📝 update javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
venusdrogon committed Oct 15, 2019
1 parent ac2b217 commit 3f6df9d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public void send() throws Exception{
mailSenderConfig.setiCalendar(ICalendarBuilder.build());

Message message = MessageBuilder.build(mailSenderConfig);

if (null != mailSenderConfig.getiCalendar()){
message.setContent(buildContent(mailSenderConfig));
}
Expand Down Expand Up @@ -64,7 +63,7 @@ static BodyPart build(MailSenderConfig mailSenderConfig) throws MessagingExcepti

@Override
protected String getConfigFile(){
return "mail-baozun.properties";
return "mail-bz.properties";
}

//---------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ public class EmailCalendarTest extends AbstractMailSenderTest{

@Test
public void testEmailTest() throws Exception{

String from = "feilongtestemail@163.com";
String to = "xin.jin@baozun.cn";
String to = "xin.jin@baozun.com";
Properties prop = new Properties();
prop.put("mail.smtp.host", "smtp.163.com");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,20 @@

public class EmailCalendarTest2 extends AbstractMailSenderTest{

/**
* Send.
*
* @throws Exception
* the exception
*/
@Test
public void send() throws Exception{
mailSenderConfig.setContent("hello hahaha");

//---------------------------------------------------------------

String fromEmail = "feilongtestemail@163.com";
String toEmail = "xin.jin@baozun.cn";
String toEmail = "xin.jin@baozun.com";
Session session = SessionFactory.createSession(mailSenderConfig);
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(fromEmail));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(toEmail));
message.setSubject("Outlook Meeting Request Using JavaMail");

//---------------------------------------------------------------

BodyPart messageBodyPart = new MimeBodyPart();
// 测试下来如果不这么转换的话,会以纯文本的形式发送过去,
//如果没有method=REQUEST;charset=\"UTF-8\",outlook会议附件的形式存在,而不是直接打开就是一个会议请求
Expand All @@ -76,17 +68,11 @@ public void send() throws Exception{
message.setContent(multipart);

//---------------------------------------------------------------

Transport.send(message);
}

//---------------------------------------------------------------

/**
* @param toEmail
* @return
* @since 1.13.2
*/
private String buildContent(String toEmail){
StringBuffer buffer = new StringBuffer();
buffer.append(
Expand Down

0 comments on commit 3f6df9d

Please sign in to comment.