发送邮件作为警告 [英] Send mail as a warning

查看:117
本文介绍了发送邮件作为警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果邮件没有得到答复,是否有可能发送警告

Is there a possibility if the mail is not answered, it sends a warning

推荐答案

我建​​议跟踪DeliveryNotification,并给他们一些时间进行回复.
如果时间到了,再发送一封高优先级的邮件.这将使您能够确认邮件的传递(不确定收件人是打开还是阅读).

样本:

I would suggest track DeliveryNotification, and give them some time to make reply.
When the time exceeds, send another mail with high priority. This would enable you to confirm delivery of the mail(not sure if the recipient opened or read).

Sample:

//create the mail message
try
{ 
     using(MailMessage mail = new MailMessage())
    {
    //set the addresses
    mail.From = new MailAddress("username@somedomain.com");
    mail.To.Add("recipient@yahoo.com");
    //set the content
    mail.Subject = "This is an email";
    mail.Body = "this is the body content of the email.";
    mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess;
    
    //Add "Disposition-Notification-To" for Read receipt
    mail.Headers.Add("Disposition-Notification-To", "<username@somedomain.com>");
     //Set the SMTP server. You can also set the hostname instead of IP Address
    SmtpClient smtp = new SmtpClient("18.204.1.5");    
    
    //Set the user network/domain credentials
    NetworkCredential netCredit = new NetworkCredential("username@somedomain.com", "yourpassword", "DOMAIN");
    
    //Get SMTP to authenticate the credentials
    smtp.Credentials = netCredit;
    
    //Send the e-mail
    smtp.Send(mail);
    }
}
catch (FormatException ex)
{
   //Track  ex.Message
}
catch (SmtpException ex)
{
   //Track  ex.Message
}


捕获/跟踪所有异常,还跟踪传递失败"消息,并从用于传递通知/发件人收件箱的收件箱中读取回执.将它们存储在DB/XML等中.还跟踪邮件的答复.现在,您可以使用捕获的数据轻松确定是否需要发送警告邮件.

谢谢,

Kuthuparakkal


Capture/track all exceptions and also track Delivery Failed messages and read reciepts from the inbox set for delivery notification/sender inbox.. Store them in DB/XML etc. Also track the reply for the mail. Now you can easily decide if you need send a warning mail using the data you have captured.

Thanks,

Kuthuparakkal


这篇关于发送邮件作为警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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