我想知道如何设置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;
}