I use MailAddress to create a fax. We use a system called SatisFAXtion v 8.6. To provide a cover page for sending faxes, I can add the template location to mail.TO.
The format is as follows:
12125551234^template=cp\\ FAXReportCover.rtf@fax.ourcompanymail.com
It works fine when compiling, but I need two backslashes, so I added two more escape characters.
When I run the program, I get an exception:
Message: An invalid character was found in the mail header: StackTrace: at System.Net.Mail.MailAddressParser.ParseLocalPart(String data, Int32& index, Boolean expectAngleBracket, Boolean expectMultipleAddresses) at System.Net.Mail.MailAddressParser.ParseAddress(String data, Boolean expectMultipleAddresses, Int32& index) at System.Net.Mail.MailAddressParser.ParseMultipleAddresses(String data) at System.Net.Mail.MailAddressCollection.ParseValue(String addresses) at System.Net.Mail.MailAddressCollection.Add(String addresses) at System.Net.Mail.Message..ctor(String from, String to) at System.Net.Mail.MailMessage..ctor(String from, String to)
Is there a way to insert a backslash in an email address in a MailAddress object?
source share