在 Java 中使用邮件服务器

发布于 2024-09-06 11:52:12 字数 1539 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

顾忌 2024-09-13 11:52:12

您还可以使用 JavaMail API 读取常规邮件服务器上的 POP3/IMAP 邮箱。这使得您可以更轻松地使用常规域中的邮箱。 Camel 对这些 API 进行了高级封装,使其能够非常轻松地与邮箱集成、转换内部消息并将结果发送到需要的地方。

现在,如果您需要做的事情很简单,那么您可以配置大多数邮件服务器以将邮件传递到脚本。这确实很容易,但是 Java 不太适合编写这个脚本,因为 JVM 的启动成本太高了。一个简单的批处理脚本或 perl/ruby/vbscript 就可以满足您的需求。

You can also use JavaMail API to read a POP3/IMAP mailbox on your regular mail server. This makes it easier to use a mailbox in your regular domain. Camel packages these API's at a high level and makes it really easy to integrate with mailboxes, transform the message inside and send the results wherever they are needed.

Now if it are easy things you need to do then you can configure most mailservers to deliver mails to a script. This is REALLY easy but Java is not really suitable to write this script in because the startup cost of the JVM is too high. A simple batch script or perl/ruby/vbscript thingy could be all you need.

柏拉图鍀咏恒 2024-09-13 11:52:12

您是说您想使用 Java 将邮件消息发送到邮件服务器上配置的邮箱或从邮箱中读取并处理消息吗?那么您只是想知道可以在本地电脑上安装一个邮件服务器来进行测试吗?如果是这种情况,并且您运行的是 Windows 操作系统,则可以安装 hMailServer。如果您使用的是 Linux / Unix,您可以配置 Postfix

Are you saying you want to use Java to send a mail message to a mailbox configured on your mail server or to read from the mailbox and to process the message? So you just want to know of a mail server you can install on your local pc to test with? If that's the case and you are running on a Windows OS you can install hMailServer. If you are using Linux / Unix you can configure Postfix.

时光磨忆 2024-09-13 11:52:12

Apache James 是一个用 Java 编写的邮件服务器,您可以使用。

Apache James is a mail server written in Java that you could use.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文