System.Net.Mail - Invalid Characters in the Mail Address

How do I send an email using SYstem.Net.Mail to an unusual email address (myFirstName.O ' Reilly@mywebsite.com ) but still RFC 5322 ?

Does .NET support sending mail addresses with single quotes in them, and if so, how do I get the system to allow sending emails to those addresses? We are currently using the System.Net.Mail class to send mail, but it bombs these types of email addresses.

+1


source to share


1 answer


It should work - http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/84dd5b66-f68d-4b0c-823f-25aa7c7b4d6b/



i.e. create a MailAddress ("myFirstName.O ' Reilly@mywebsite.com ") and then use that to create a MailMessage and go to SmtpClient.Send.

+3


source







All Articles