电子邮件未使用 SmtpClient 发送到某些电子邮件地址

发布于 2024-07-23 02:50:44 字数 317 浏览 6 评论 0原文

我为客户创建了一个简单的 asp.net 电子邮件表单,它使用 SmtpClient 类发送电子邮件。 它非常基础并且在大多数情况下都有效。

该表格在许多网站中使用,但只能间歇性地发挥作用。 该代码始终有效,不会引发任何异常,它只是正常工作,但间歇性地工作,并且对于某些客户端,电子邮件永远不会到达“收件人”地址。 如果更改为外部电子邮件(例如我的个人 Hotmail 帐户),它可以正常工作。

我们已要求收件人检查垃圾邮件收件箱,但无济于事。 如何追踪这一问题? 我如何知道我的客户 asp.net 服务器是否已发送电子邮件(在这种情况下问题出在收件人端)?

I have created a simple asp.net email form for a client, which is sending off emails using the SmtpClient class. It is very basic and works in most instances.

The form is used in a number of websites but it only works intermittently. The code always works and does not throw any exceptions, it just works correctly but intermittently and for certain clients, the email never reaches the To address. If changes to an external email (e.g. my personal Hotmail account) it works correctly.

We have asked the recipients to check their spam inboxes but to no avail. How would one be able to track this issue? How can I know that my clients asp.net server has sent the email (in which case the problemm is at the recipients end) or not?

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

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

发布评论

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

评论(4

小忆控 2024-07-30 02:50:44

查看您在 Hotmail 帐户中收到的电子邮件的标头,并查看 From:Reply-To: 字段的设置。

然后查看源代码,与您要求的设置进行比较。

您可能会从 SMTP 服务器(您的或另一台前往目的地的服务器)收到退回邮件,并且该邮件可能会发送到电子邮件的发件人:地址。

检查您是否有处理异常的代码,使用不正确的详细信息进行测试并查看 StatusCode 返回的内容。

Look at the headers in the e-mail you got in your hotmail account and see what the From: and Reply-To: fields are set to.

Then look through your source code to compare with what you're asking it to be set to.

You might be getting a bounce message from an SMTP server (yours or another one en route to the destination) and it might be sent to the From: address of the e-mail.

Check that you have code to handle exceptions, test with incorrect details and see what StatusCode returns.

牛↙奶布丁 2024-07-30 02:50:44

您是否可以控制 SMTP 服务器,以便可以访问其日志并查看其运行情况?

如果没有,您可以设置一个您可以控制的 SMTP 服务器,该服务器仅将电子邮件传递到真实服务器,但会记录内容。

您是否将发件人地址设置为有效的地址,以便您可以查看是否有返回的失​​败消息?

恐怕没有答案,但也许这些问题会给你一些可能有帮助的想法。

Do you have control over the SMTP server, so you can access its logs and see what's going through it?

If not, can you set up an SMTP server that you can control, which just passes email on to the real server, but logs things.

Do you have the sender address set to something valid, so you can see if there are any failure messages coming back?

No answers, I'm afraid, but perhaps the questions will give you some ideas that may help.

抱着落日 2024-07-30 02:50:44

如果您的客户端使用 Exchange 服务器,那么您可以使用邮件跟踪来查看邮件发生了什么情况。 如果他们使用内置的 IIS SMTP 服务器,您也可以启用日志记录以查看发生的情况。 就像提到的第一篇文章一样,检查消息标题并确保它们有效......

If your clients are using Exchange server, then you can use message tracking to see what happened to the message. If they are using the built in IIS SMTP server, you can enable logging to see what is happening as well. Like the first post mentioned, check you message headers and make sure they are valid...

半暖夏伤 2024-07-30 02:50:44

您能否访问属于“发件人:”地址的邮箱。 任何递送错误都将发送到该地址。

如果发件人地址不存在,则可能导致邮件未送达。 某些邮件服务器会检查发件人地址是否存在,以试图阻止某些垃圾邮件。

Can you access the mailbox that belongs to the From: address. Any delivery errors will be sent to that address.

If the From address doesn't exists, then that's a probable cause that the mail is not delivered. Some mail server check if the from address exists, in an attempt to block some spam.

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