以下のコード スニペットを参照してください。
アプリケーションで、無効なメール アドレスを入力すると、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);
このコードに欠けているものはありますか?
助けが必要。
ありがとうございました、