smtpclient.send() 成功地将电子邮件发送到错误的地址(地址不存在)

发布于 2024-09-16 16:05:51 字数 64 浏览 3 评论 0原文

我需要检查邮件是否成功发送给指定用户 但对于甚至不存在的电子邮件地址,此函数不会返回错误

如何处理

i need to check if the mail is sent to specified user successfully
but this function returns no error for the email addresses that even doesnt exists

how to handle this

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

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

发布评论

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

评论(3

阳光的暖冬 2024-09-23 16:05:51

你无法处理这个。邮件服务器仅拒绝它知道不正确的地址。任何可能存在的地址都必须传递到接收邮件服务器,该服务器可以确定它是否知道如何处理它。

对于任何不正确的地址,您通常会收到一封返回发件人地址的错误邮件。

You can't handle this. The mail server only rejects addresses that it knows are incorrect. Any address that might exist has to be passed along to the recieving mail server that can determine if it knows what to do about it.

For any incorrect address you will normally get an error mail back to the sender address.

白色秋天 2024-09-23 16:05:51

只有服务器才能知道地址是否正确,因为服务器确实尝试向收件人发送电子邮件。客户端没有任何方法知道这一点,因为它只与它自己的服务器通信。这就是为什么大多数网站都使用两步用户注册的原因:
1. 用户输入电子邮件,网站向该地址发送确认信息
2. 用户必须点击确认电子邮件中的链接以证明电子邮件正确。只有在新用户被接受之后。

Only server can know if the address is correct because the server really tries to send email to recipient. Client does not have any means to know that because it talks only to it's own server. That's why most of the sites use 2-step user registration:
1. User enters email and site sends confirmation to the address
2. User must click a link in the confirmation email to prove that email is correct. Only after that new user gets accepted.

橘味果▽酱 2024-09-23 16:05:51

在 C# 中,您可以将 DeliveryNotificationOptions 设置为 DeliveryNotificationOptions.OnFailure
如果失败,您将在发件人收件箱中收到一封有关失败的电子邮件

in C# you can set DeliveryNotificationOptions to DeliveryNotificationOptions.OnFailure
and if it's failure you will get an email in the sender inbox about the failure

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