get meeting organizer mail address EWS API

偶尔善良 提交于 2019-12-08 19:57:21

问题


I would like to get the meeting organizer mail address with the EWS API. Currently I'm just getting the a few properties of my appointment item. I heard that you can set which properties you want to get. My code looks like that:

CalendarView cview = new CalendarView(start, end);
                    cview.PropertySet = new PropertySet(BasePropertySet.FirstClassProperties);
                    FindItemsResults<Appointment> appResults = calenFolder.FindAppointments(cview);

回答1:


I had the same issue and managed to populate the Organizer.Address property using this:

ExchangeService service = calenFolder.Service;
service.LoadPropertiesForItems(appResults, PropertySet.FirstClassProperties);



回答2:


I know the question is old, but since I found it, others may find it as well. And then, the solution is five years older than this question.

The solution is in fact simple and will be found quickly when trying to post this problem at the microsoft forums:

http://social.msdn.microsoft.com/Forums/en-US/0403c00e-008d-4eb2-a061-45e60664573e/how-can-i-get-smtp-address-to-an-organizer-with-ews?forum=exchangesvrdevelopment

Short summary:

The organizer field does not contain an SMTP Address when retrieved with ExchangeService.FindAppointments, but it does if retrieved with ExchangeService.BindToItems or Appointment.Bind.




回答3:


there is a property in the appointment item for that , which is Organizer.Address

so if you have appointment variable called appointment the following code retrieves the organizer address

Var address = appointment.Organizer.Address;

Try to use this code

var appointments = _service.FindAppointments(WellKnownFolderName.Calendar, new CalendarView(start,end));
foreach (var appointment in appointments)
{System.Diagnose.Writeline(appointment.Organizer.Address)}


来源:https://stackoverflow.com/questions/11825359/get-meeting-organizer-mail-address-ews-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!