GreenMail 介绍
GreenMail 是一组主要用来做测试用的邮件服务器,支持 SMTP、POP3、IMAP 等,可以用来嵌入到任何的 Java 程序中。
示例代码
public void testYourSendingCode() throws Exception { GreenMail greenMail = new GreenMail(); //uses test ports by default greenMail.start(); GreenMailUtil.sendTextEmailTest("[email protected]", "[email protected]", "subject", "body"); //replace this with your send code assertEquals("body", GreenMailUtil.getBody(greenMail.getReceivedMessages()[0])); greenMail.stop(); // **That's it!** }
GreenMail 官网
http://www.icegreen.com/greenmail/
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。