I need to send a email from application with text in the from field. I have the from email address, but how do I mask the email address so the from message renders the text not the email address?
+1
A:
MailAddress (that you will use for 'To' and 'From' properties) can take a display name along with the address in its constructor. You need to verify how different mail clients use the value to display (most use a combination of both).
Mohit Chakraborty
2009-03-12 19:31:43
+1
A:
You can add a name to the sender this way, using the MailAddress object:
MailMessage message = new MailMessage();
message.From = new MailAddress("[email protected]", "John Doe");
splattne
2009-03-12 19:48:25
MailMessage message = new MailMessage();message.From = new MailAddress("John Doe", "[email protected]");
Dedrick
2009-03-12 20:15:39
According to http://msdn.microsoft.com/en-us/library/1s17zfkf.aspx it's address first, then name
splattne
2009-03-12 21:34:10