Java 应用程序接收传入电子邮件的最简单方法是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/561011/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the easiest way for a Java application to receive incoming email?
提问by flybywire
Sending email is easy with commons-email, and with spring it is even easier. What about receiving incoming email? Are there easy to use APIs that allow to bounce emails, process attachments, etc.
使用 commons-email 发送电子邮件很容易,使用 spring 则更容易。收到传入的电子邮件怎么办?是否有易于使用的 API 允许退回电子邮件、处理附件等。
回答by Peter ?tibrany
SubEthaSMTP Mail Serverallows you to create your own SMTP Server for receiving emails.
SubEthaSMTP 邮件服务器允许您创建自己的 SMTP 服务器来接收电子邮件。
回答by jcrossley3
Jamesis probably your best bet, but email handling is extremely complex, requiring not only configuration of your MTA (the James server), but also DNS. In the past, I've found it easier to initiate my handlers via hooks from non-Java MTA's like postfix. And procmail might also be useful to you. For a Java MTA though, James rocks.
James可能是您最好的选择,但电子邮件处理极其复杂,不仅需要配置 MTA(James 服务器),还需要配置 DNS。过去,我发现通过来自非 Java MTA 的钩子(如 postfix)更容易启动我的处理程序。procmail 也可能对您有用。尽管如此,对于 Java MTA,James 还是很震惊的。
回答by guerda
Apache Commons Netis the perfect library to fetch mails via POP3. IMAP is not supported.
Apache Commons Net是通过 POP3 获取邮件的完美库。不支持 IMAP。

