本文整理汇总了Java中com.icegreen.greenmail.util.GreenMailUtil.sendMessageBody方法的典型用法代码示例。如果您正苦于以下问题:Java GreenMailUtil.sendMessageBody方法的具体用法?Java GreenMailUtil.sendMessageBody怎么用?Java GreenMailUtil.sendMessageBody使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.icegreen.greenmail.util.GreenMailUtil
的用法示例。
在下文中一共展示了GreenMailUtil.sendMessageBody方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendTestMails
import com.icegreen.greenmail.util.GreenMailUtil; //导入方法依赖的package包/类
private void sendTestMails(String subject, String body) throws MessagingException {
GreenMailUtil.sendTextEmailTest("[email protected]", "[email protected]", subject, body);
// Create multipart
MimeMultipart multipart = new MimeMultipart();
final MimeBodyPart part1 = new MimeBodyPart();
part1.setContent("body1", "text/plain");
multipart.addBodyPart(part1);
final MimeBodyPart part2 = new MimeBodyPart();
part2.setContent("body2", "text/plain");
multipart.addBodyPart(part2);
GreenMailUtil.sendMessageBody("[email protected]", "[email protected]", subject + "__2", multipart, null, ServerSetupTest.SMTP);
}
示例2: testLargeMessageBody
import com.icegreen.greenmail.util.GreenMailUtil; //导入方法依赖的package包/类
@Test
public void testLargeMessageBody() throws MessagingException, IOException {
String to = "[email protected]";
GreenMailUtil.sendMessageBody(to, "[email protected]", "Subject", createLargeByteArray(), "application/blubb",
greenMail.getSmtp().getServerSetup());
greenMail.waitForIncomingEmail(5000, 1);
retrieveAndCheckBody(greenMail.getPop3(), to);
retrieveAndCheckBody(greenMail.getImap(), to);
}