我将使用MailAddress来创建传真邮件。
我们正在使用名为SatisFAXtion v 8.6的系统。
如果要提供传真封面,我可以将模板位置添加到mail.TO地址中。
格式如下:
有没有办法在MailAddress对象中插入电子邮件地址的反斜杠?
格式如下:
12125551234^template=cp\\FAXReportCover.rtf@fax.ourcompanymail.com
编译时没问题,但我需要两个反斜杠,所以我添加了两个作为转义字符。
运行程序时出现异常:
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)
有没有办法在MailAddress对象中插入电子邮件地址的反斜杠?
"\"12125551234^template=cp\\\\FAXReportCover.rtf\"" + "@fax.ourcompanymail.com"
- Boguslaw Buczek