views:

623

answers:

4

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?

A: 

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.

Bing
A: 

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.

Randy Orrison
A: 

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...

Zachary
A: 

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.

Sander Rijken