当前位置: 首页>>代码示例>>Java>>正文


Java GreenMailUtil.sendMessageBody方法代码示例

本文整理汇总了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);
}
 
开发者ID:greenmail-mail-test,项目名称:greenmail,代码行数:15,代码来源:ExampleSendNoRuleAdvTest.java

示例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);
}
 
开发者ID:greenmail-mail-test,项目名称:greenmail,代码行数:11,代码来源:LargeMessageTest.java


注:本文中的com.icegreen.greenmail.util.GreenMailUtil.sendMessageBody方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。