使用System.Net.Mail.MailAddress设置退回地址

时间:2011-06-13 16:33:00

标签: c# mailmessage email-address bouncedemail email-bounces

我想知道如何设置microsoft MailAddress对象的退回地址。我尝试设置发件人,但这似乎不起作用。有什么建议?这是我正在使用的一些示例代码:

MailMessage message = new MailMessage(FromAddress, ToAddress);

message.Subject = Subject;
message.Body = BodyHTML;
message.IsBodyHtml = true;
if (!string.IsNullOrEmpty(BounceEmailAddress))
{
  MailAddress bounceAddress = new MailAddress(BounceEmailAddress);
  message.Sender = bounceAddress;
}

0 个答案:

没有答案