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=""john smith" <jsmith@somewhere.com>">
Comments
Post a Comment