Process Bounced Email (Non-Delivery Report) and Email Tracking


For many email campaign applications, the very important task is detecting if the email is received by recipient or not. Parsing the delivery report is the common way to get the email status. It is strongly recommend that you remove the invalid or non-existent recipient from your mail listing to save networking resource.

SMTP Transport Error and Failure Report (NDS)

When you are sending an email to a recipient by EASendMail:

SMTP Transport Error and Failure Report are supported by all SMTP servers, so we strongly recommend that you catch SMTP Transport Error and parse Failure Report (NDS).

Delivery Receipt

It is also called a DSN (delivery service notification), which is a request to the recipient’s email server to send you a notification about the delivery of an email you've just sent. The notification takes the form of an email, and will tell you if your delivery succeeded (Delivery Receipt), failed, got delayed (Failure Report (NDS)).

Import Notice: Not every SMTP server support Delivery Receipt. Only the SMTP server that supports DSN extension command accepts Delivery Receipient request, otherwise you will get error when you are sending email.

The following example codes demonstrate how to request read receipt and delivery receipt:

//[C#]
// The following example codes demonstrate requesting read receipt and delivery receipt
// To get full sample projects, please download and install EASendMail on your machine.
// To run it correctly, please change SMTP server, user, password, sender, recipient value to yours

using System; 
using System.Collections.Generic; 
using System.Text; 

// Add EASendMail namespace
using EASendMail; 

namespace mysendemail 
{ 
    class Program 
    { 
        static void Main(string[] args) 
        { 
            SmtpMail oMail = new SmtpMail("TryIt"); 
            SmtpClient oSmtp = new SmtpClient(); 

            // Set sender email address, please change it to yours
            oMail.From = "test@emailarchitect.net"; 

            // Set recipient email address, please change it to yours
            oMail.To = "support@emailarchitect.net"; 

            // Set email subject
            oMail.Subject = "test email from c# project"; 

            // Set email body
            oMail.TextBody = "this is a test email sent from c# project, do not reply"; 

            // Your SMTP server address
            SmtpServer oServer = new SmtpServer("smtp.emailarchitect.net"); 

            // User and password for ESMTP authentication, if your server doesn't require
            // User authentication, please remove the following codes.
            oServer.User = "test@emailarchitect.net"; 
            oServer.Password = "testpassword"; 

            // If your smtp server requires SSL connection, please add this line
            // oServer.ConnectType = SmtpConnectType.ConnectSSLAuto;

            // Request read receipt
            oMail.ReadReceipt = true; 

            // Request both failure and success report
            oMail.DeliveryNotification = DeliveryNotificationOptions.OnFailure | 
                DeliveryNotificationOptions.OnSuccess; 

            try 
            { 
                Console.WriteLine("start to send email ..."); 
                oSmtp.SendMail(oServer, oMail); 
                Console.WriteLine("email was sent successfully!"); 
            } 
            catch (Exception ep) 
            { 
                Console.WriteLine("failed to send email with the following error:"); 
                Console.WriteLine(ep.Message); 
            } 
        } 
    } 
} 

'[VB]
' The following example codes demonstrate requesting read receipt and delivery receipt
' To get full sample projects, please download and install EASendMail on your machine.
' To run it correctly, please change SMTP server, user, password, sender, recipient value to yours

' Add EASendMail namespace
Imports EASendMail 

Module Module1 
    Sub Main() 
        Dim oMail As New SmtpMail("TryIt") 
        Dim oSmtp As New SmtpClient() 

        ' Set sender email address, please change it to yours
        oMail.From = "test@emailarchitect.net" 

        ' Set recipient email address, please change it to yours
        oMail.To = "support@emailarchitect.net" 

        ' Set email subject
        oMail.Subject = "test email from VB.NET project" 

        ' Set email body
        oMail.TextBody = "this is a test email sent from VB.NET project, do not reply" 

        ' Your SMTP server address
        Dim oServer As New SmtpServer("smtp.emailarchitect.net") 

        ' User and password for ESMTP authentication, if your server doesn't require
        ' User authentication, please remove the following codes.
        oServer.User = "test@emailarchitect.net" 
        oServer.Password = "testpassword" 

        ' If your SMTP server requires SSL connection, please add this line
        ' oServer.ConnectType = SmtpConnectType.ConnectSSLAuto

        ' Request read receipt
        oMail.ReadReceipt = True 

        ' Request both failure and success report
        oMail.DeliveryNotification = DeliveryNotificationOptions.OnFailure Or _ 
            DeliveryNotificationOptions.OnSuccess 

        Try 

            Console.WriteLine("start to send email ...") 
            oSmtp.SendMail(oServer, oMail) 
            Console.WriteLine("email was sent successfully!") 

        Catch ep As Exception 

            Console.WriteLine("failed to send email with the following error:") 
            Console.WriteLine(ep.Message) 
        End Try 

    End Sub 
End Module 
    

Email Tracking

Email tracking is used to verify that emails are actually read by recipients. There are two common solutions:

Test Email Address

See Also

Using EASendMail SMTP .NET Component
User Authentication and SSL Connection
From, ReplyTo, Sender and Return-Path
Digital Signature and E-mail Encryption
DomainKeys and DKIM Signature
Send E-mail Directly (Simulating SMTP server)
Work with EASendMail Service (Email Queuing)
Bulk Email Sender Guidelines
EASendMail .NET Namespace References
EASendMail SMTP Component Samples