can i set the display name in MailMessage object ???

0 votes
asked Mar 27, 2015 by rockyshah2015 (750 points)

When I create a MailMessage object I want the From to be "noreply@domain.com" and the display name should be my original name can I do it in rebex Mailmessage object????

Applies to: Rebex Secure Mail

1 Answer

0 votes
answered Mar 27, 2015 by Tomas Knopp (58,880 points)

Yes, it is possible, just use the MailAddress class like this:

MailMessage mail = new MailMessage();
mail.From = new MailAddress("noreply@domain.com", "Chuck Norris");
...