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


currently have:

<system.net>     <mailsettings>     <smtp from="me@mydomain.com">         <network               host="localhost"               port="25"              />       </smtp>     </mailsettings>   </system.net> 

how can change email sent name , not email address only?

well, in code need put sender's name in quotes, followed e-mail address.

new smtpclient(...).send("\"john smith\" jsmith@somewhere.com", ...); 

and...it looks can encode attribute too...

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

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -