Thursday 18 April 2013

How can setup a friendly email name in the MailSetting section of web.config?


Well, in code you need to put the sender's name in quotes, followed by the e-mail address.

new SmtpClient(...).Send("\"John Smith\" jsmith@somewhere.com", ...);
And...it looks like you can encode it into the attribute too...

<smtp from="&quot;John Smith&quot; &lt;jsmith@somewhere.com&gt;">

No comments:

Post a Comment