How do I change the TO address to a friendly name? The same technique used to display a friendly FROM name, is the same technique used to display friendly TO and CC fields. By default typical .To code looks like:
mail.To = "me@mycompny.com"
mail.To = "\"Jane Doe\" <me@mycompny.com>""
MailMessage mail = new MailMessage(); mail.To = "\"Jane Doe\" <me@mycompany.com>"; mail.From = "\"John Smith\" <you@yourcompany.com>"; mail.Subject = "this is a test email."; mail.Body = "this is my test email body."; SmtpMail.SmtpServer = "localhost"; //your real server goes here SmtpMail.Send( mail );
Dim mail As New MailMessage() mail.To = """Jane Doe"" <me@mycompany.com>" mail.From = """John Smith"" <you@yourcompany.com>" mail.Subject = "this is a test email." mail.Body = "this is my test email body." SmtpMail.SmtpServer = "localhost" 'your real server goes here SmtpMail.Send(mail)
Copyright © 2004 Contact: Dave Wanta. aspNetEmail aspNetPOP3 aspNetMime