在这个月 Aspose.Email for .NET邮件处理控件发布了新的16.10版本,通过该控件开发人员可以使用API来像OutLook一样在应用程序中对邮件进行发送、接收、读取和处理,在新的版本中开发人员可以通过API获取联系人信息和扩展属性,如何获取联系人的扩展信息可以参考下面的部分代码:
IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain");
//The required extended properties must be added in order to create or read them from the Exchange Server
string[] extraFields = new string[] {{ "User Field 1", "User Field 2", "User Field 3", "User Field 4" }};
foreach (string extraField in extraFields)
client.ContactExtendedPropertiesDefinition.Add(extraField);
//Create a test contact on the Exchange Server
Contact contact = new Contact();
contact.DisplayName = "EMAILNET-38433 - " + Guid.NewGuid().ToString();
foreach (string extraField in extraFields)
contact.ExtendedProperties.Add(extraField, extraField);
string contactId = client.CreateContact(contact);
//retrieve the contact back from the server after some time
Thread.Sleep(5000);
contact = client.GetContact(contactId);
//Parse the extended properties of contact
foreach (string extraField in extraFields)
if (contact.ExtendedProperties.ContainsKey(extraField))
Console.WriteLine(contact.ExtendedProperties[extraField].ToString());