views:

550

answers:

1

How can I send an email using SYstem.Net.Mail to an email address that is unusual (myFirstName.O'[email protected]) but is still RFC 5322 compliant?

Does .NET support sending mail addresses that have single quotes in them, and if so, how do I force the system to allow email to be sent to those addresses? Right now we're using the System.Net.Mail class to send mail, but it's bombing on those specific types of email addresses.

+2  A: 

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

i.e. create MailAddress("myFirstName.O'[email protected]"), and then use that to create a MailMessage, and pass to SmtpClient.Send.

Mark