How to track bounced emails and how to track mail is delivered?,

Here the following code i have used.

try
{
  Configuration configurationFile = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~/web.config");
                System.Net.Configuration.MailSettingsSectionGroup mailSettings = configurationFile.GetSectionGroup("system.net/mailSettings") as System.Net.Configuration.MailSettingsSectionGroup;


                string from = string.Empty;
                if (mailSettings != null)
                {
                    from = mailSettings.Smtp.From;
                }
                string myString="<html><head>test email tracking </head><body><p>this is test mail for email tracking</p></body></html>";

                string toAddress = "mohanj@icore.net.in";

                myString = myString.Replace("<body>", "<body><IMG height=1 src='http://icoremail.icore.net.in/testresponse.aspx?emailsent=" + toAddress + "' width=1></IMG>");



                using (MailMessage message = new MailMessage(

             //  from, "mohanj.icore@gmail.com",

             from, "mohanj@icore.net.in",
        "A report for you!", myString))
                {
                    message.IsBodyHtml = true;

                    SmtpClient smtp = new SmtpClient();

                    smtp.Send(message);
                    lblMessage.Text = " Mail Sent successfully! ";

                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }

Can I acheive this using "DeliveryNotificationOptions" in asp.net

Thanks a lot. The Correct answer would be appreciated.

Related posts

Recent Viewed