Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 4.0 在Outlook中未使用C#代码接收回退电子邮件_C# 4.0_Smtpclient - Fatal编程技术网

C# 4.0 在Outlook中未使用C#代码接收回退电子邮件

C# 4.0 在Outlook中未使用C#代码接收回退电子邮件,c#-4.0,smtpclient,C# 4.0,Smtpclient,请看下面的代码片段,我已经尝试过了 在我的应用程序中,当我输入无效的电子邮件地址时,我不会在Outlook中收到回退电子邮件 MailMessage message = new MailMessage("noreply@mail.CLIENTURL.extra.org", strTo); message.Subject = strSubject; message.IsBodyHtml = true; message.ReplyT

请看下面的代码片段,我已经尝试过了

在我的应用程序中,当我输入无效的电子邮件地址时,我不会在Outlook中收到回退电子邮件

      MailMessage message = new MailMessage("noreply@mail.CLIENTURL.extra.org", strTo); 

        message.Subject = strSubject;
        message.IsBodyHtml = true; 

        message.ReplyTo = new MailAddress("consult@mail.CLIENTURL.extra.org") ; 
        message.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure | DeliveryNotificationOptions.OnSuccess | DeliveryNotificationOptions.Delay;
        message.Headers.Add("Return-Path", "consult@mail.CLIENTURL.extra.org"); 


        message.AlternateViews.Add(strBody); 
        if (strAttachment != "") 
        { 
            Attachment At = new Attachment(strAttachment); 
            message.Attachments.Add(At); 
        } 

       message.Priority = MailPriority.High; 
        SmtpClient smtpClient = new SmtpClient(ConfigurationSettings.AppSettings["SmtpServer"]); 
        smtpClient.UseDefaultCredentials = true; 

        smtpClient.Send(message); 
这段代码中有我遗漏的东西吗

我需要帮助


谢谢,

代码对我来说似乎很好……您检查了SMTP服务器错误日志了吗