EWS C#国际字符在电子邮件地址返回错误

时间:2012-10-18 15:42:21

标签: c# exchangewebservices

当电子邮件地址包含外来字符时,我在使用EWS将电子邮件地址保存到联系人时遇到问题。特别是,德国变形金刚给了我一些问题。以下是尝试创建有效电子邮件地址的示例。 EWS返回错误,指出电子邮件地址无效。有人可以帮忙吗?感谢

Mailbox mailbox = new Mailbox("box@blah.com");
FolderId folderId = new FolderId(WellKnownFolderName.Contacts, mailbox);
Contact contact = new Contact(service);
contact.GivenName = "John";
contact.Surname = "Döe";

EmailAddress address = new EmailAddress();
address.Address = "JohnDöe@blah.com";
address.RoutingType = "SMTP";

contact.EmailAddresses[EmailAddressKey.EmailAddress1] = address;
contact.Save(folderId);

1 个答案:

答案 0 :(得分:0)

Exchange是否允许电子邮件地址中的变音符号?

电子邮件地址的管理规范

RFC 5321不允许这样做。有关详细信息,请参阅this SO question on allowed email address characters