0

以下のコード スニペットを参照してください。

アプリケーションで、無効なメール アドレスを入力すると、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); 

このコードに欠けているものはありますか?

助けが必要。

ありがとうございました、

4

1 に答える 1

0

コードは問題ないように思えます...SMTP サーバーのエラー ログを確認しましたか?

于 2013-11-04T16:41:42.710 に答える