我如何知道 smtp 服务器是否已发送我的电子邮件?

发布于 2024-08-18 22:39:03 字数 60 浏览 2 评论 0原文

假设我使用 smtpclient 将电子邮件提交到本地 smtp 服务器。我如何知道电子邮件是否真正发送?

Say I use smtpclient to submit my email to my local smtp server. How do I know if the email was actully sent or not?

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

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

发布评论

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

评论(2

2024-08-25 22:39:03

底线是,你不知道。

SMTP 是一种断开连接的协议,而不是事务性协议。当您发送电子邮件时,SMTP 只知道您和服务器之间发生的情况。您的服务器完全有可能因网络问题而对邮件进行排队,并且无法发送给最终收件人,而您永远不会知道。

您可以请求诸如 DSN(传递状态通知)之类的内容,但并非所有服务器都支持它们。如果您的服务器确实支持它们,您可能需要考虑请求一个。

我知道这不是您想要的答案,但事实就是如此。

The bottom line is, you don't.

SMTP is a disconnected protocol, not a transacted one. When you send an email, SMTP only knows what happens between you and your server. It's totally possible your server might be queuing up the mail, and not sending to the end recipient because of a network problem, and you would never know.

You can request things like DSN (Delivery Status Notifications), but not all servers support them. If your server does support them, you may want to look at requesting one.

I know this isn't the answer you want, but it is what it is.

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