如何从Outlook邮件ID跟踪未传递的邮件

时间:2012-06-26 08:39:38

标签: c# .net email

public void SendMAil()
{
    MailMessage newMail = new MailMessage();
    newMail.To.Add("xxxx@example.com");
    newMail.From = new MailAddress(ConfigurationManager.AppSettings["FromMail"].ToString(), ConfigurationManager.AppSettings["FromMailDisplayName"].ToString());
    newMail.Subject = "Hi";
    newMail.Body = "this is the body";
    SmtpClient SurveyMailClient = new SmtpClient(ConfigurationManager.AppSettings["SEMailServerIP"].ToString(), Convert.ToInt32(ConfigurationManager.AppSettings["SEMailServerPortNumber"]));
    SurveyMailClient.DeliveryMethod = SmtpDeliveryMethod.Network;
    SurveyMailClient.UseDefaultCredentials = true;
    SurveyMailClient.Send(newMail);
}

使用上面的代码,我无法跟踪Outlook邮箱中的未发送邮件(来自地址)。如果邮件成功发送,发送的邮件不会保存在已发送邮件文件夹中,如果邮件未送达,邮件传递失败通知未来到我的收件箱。所以请帮助我如何使用上面的代码跟踪我的应用程序端未传送的邮件。

1 个答案:

答案 0 :(得分:0)

SMTP只会传递邮件,您必须以某种方式手动将“副本”“发送”到“已发送邮件”文件夹中。我最好的选择是使用IMAP。