Javamail是异步的还是同步的?

发布于 2024-10-04 19:11:44 字数 149 浏览 0 评论 0原文

Javamail是异步的还是同步的?也就是说,如果我发送电子邮件,我是立即继续处理,还是等到它完成?

此外,有什么方法可以让我发现电子邮件因任何原因未能发送?

我还想知道 Spring 的 MailSender 抽象的这些答案。

谢谢。

Is Javamail asynchronous or synchronous? That is, if I send off an email, do I continue processing immediately afterwards, or do I wait until it's complete?

Furthermore, are there any ways that I could catch that an email failed to be delivered for any reason?

I'd also like to know these answers for Spring's MailSender abstraction.

Thanks.

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

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

发布评论

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

评论(1

失去的东西太少 2024-10-11 19:11:44

它是同步的,因为它将消息传输到服务器并在返回之前处理服务器的响应。 发送 文档有更详细的解释。该消息将抛出 SendFailedException 或另一个 MessagingException,
如果发送立即失败。但“成功并不意味着消息已传递给最终收件人,因为在传递的后期阶段可能会发生失败。”

It is synchronous, since it transfers the message to the server and processes the server's response before returning. The send docs explain in further detail. The message will throw a SendFailedException, or another MessagingException,
if the send fails immediately. But "success does not imply that the message was delivered to the ultimate recipient, as failures may occur in later stages of delivery."

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