如何在asp.net中跟踪Bounce电子邮件 [英] How to track Bounce emails in asp.net

查看:94
本文介绍了如何在asp.net中跟踪Bounce电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从asp.net发送邮件代码邮件非常好我没有收到任何错误

但是当我添加不存在的电子邮件地址时它不会抛出任何错误

例如,如果我的电子邮件地址是 xyz@qyzcv.com 现在这个电子邮件地址不存在但我仍然发送电子邮件到这个地址它应该给我错误但它是不是我如何生成异常?或者收到一些电子邮件尚未发送的通知

i想要跟踪代码中的退回电子邮件地址

Hi , I am sending mail from asp.net code mail is going perfectly fine i am not receiving any error
but when i adding email address which is does not exist it is not throwing any error
example if my email address is xyz@qyzcv.com now this email adress does not exist but still i am sending email to this address it should throw me error but it is not how do i generate an exception ? or get some notification that email has not been delivered
i want to track bounce email address in the code

//START THE MALING PART
System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();//instantiate mail message
SmtpClient smtp = new SmtpClient();
mail.To.Add("toemail_test@gmail.com");
mail.From = new MailAddress("FromEmail_test@gmail.com");
mail.Subject = Subject;
mail.IsBodyHtml = true;
mail.Body = Message;
smtp.Host = host;
smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
smtp.Credentials = new System.Net.NetworkCredential(FromEmail, password);
smtp.EnableSsl = true;
try
{
    //send  email
    smtp.Send(mail);

    return true;
}
catch (Exception EX)
{
    //send the bounce email
    SendBounceEmail(ToEmail, Bounceemail, Subject, Message);



}

推荐答案

您可以查看这些。 。

如何测试-asp-net-email-is-being-sent [ ^ ]

http://forums.asp.net/t/1657896.aspx/1 [ ^ ]
You can check these..
How-to-test-asp-net-email-is-being-sent[^]
http://forums.asp.net/t/1657896.aspx/1[^]


点击链接: -

DeliveryNotificationOptions枚举

< a href =http://msdn.microsoft.com/en-us/library/system.net.mail.deliverynotificationoptions.aspx> http://msdn.microsoft.com/en-us/library/system.net .mail.deliverynotificationoptions.aspx [ ^ ]

http://stackoverflow.com/questions/4801471/how-do-email-campaign-managers-report-on-bounced-emails [ ^ ]
Follow the links:-
DeliveryNotificationOptions Enumeration
http://msdn.microsoft.com/en-us/library/system.net.mail.deliverynotificationoptions.aspx[^]
http://stackoverflow.com/questions/4801471/how-do-email-campaign-managers-report-on-bounced-emails[^]


这篇关于如何在asp.net中跟踪Bounce电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆