Posted on 2012-08-23
Last Modified: 2012-09-09

Is there a way of knowing if an email or text that is sent via an 4 website is bounced or not?

Basically we want to send the email and if it bounces or isn't being delivered then somehow in code we can find this out and automae letting the user know.

Is this possible?

C# ideally.
Question by:scm0sml
    LVL 19

    Assisted Solution

    Actually it depends on the way you are sending the email.

    However, most email libraries have some sort of error control. It could be a return value or just the throwing of an exception. You can check the result of the send method execution to see if it has been succesful or if it returns an error value or an exception (wich usually includes info about the error produced).

    Check SmtpClient class documentation, as an example, for further info:
    LVL 33

    Accepted Solution

    Generally, I think, the Send method (assuming you're using SmtpClient, or something similar) almost always returns success except in cases where there's an immediate failure, such as a malformed recipient address like "user@missingdotcom", or an inaccessible SMTP server.

    In most cases it's up to the recipients server to generate an error (if there's no such user, e.g.), and send you a return e-mail message with a Non-Delivery Report (NDR).

    I've never attempted to do so, but I imagine it might be possible to attach a custom header to the message that uniquely identifies that message, like a GUID. The address you're using as the "From" field for the message would need to be valid, and able to receive mail. You'd store some information in a database, like the recipients e-mail address, along with the GUID. Periodically you would check the sender's mailbox for NDR's, and if one is found with the custom header you added to the out-going message you can compare that GUID to ones that you previously stored in a database.

    Or, I supposed you could simply check the "To" headers in any NDR's you've received as an alternative to the GUID-tracking method.
    LVL 33

    Expert Comment

    by:Todd Gerbert
    ...keep in mind that it may be days before receive any errors.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now