Is it possible to set the sender name on a MailMessage object? I tried setting it from MailAddress, but the DisplayName property seems to be read only.
I tried "My Name " as the sender and don't seem to work either.
Is it possible to set the sender name on a MailMessage object? I tried setting it from MailAddress, but the DisplayName property seems to be read only.
I tried "My Name " as the sender and don't seem to work either.
MailMessage mail = new MailMessage();
mail.From = new MailAddress("nerfDeathKnights@mycompany.com", "Bob Jones" );
From the MSDN http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx
MailMessage message = new MailMessage(
"jane@contoso.com",
"ben@contoso.com",
"Quarterly data report.",
"See the attached spreadsheet.");