Get EWS API Email Organizer Address

I would like to receive the email address of the meeting organizer with the EWS API. Currently, I'm just getting a few properties of my destination. I heard that you can set what properties you want to get. My code is as follows:

CalendarView cview = new CalendarView(start, end); cview.PropertySet = new PropertySet(BasePropertySet.FirstClassProperties); FindItemsResults<Appointment> appResults = calenFolder.FindAppointments(cview); 
+6
source share
3 answers

I know the question is old, but since I found it, others can find it. And then the decision is five years older than this issue.

The solution is actually simple and will be quickly found when trying to post this problem on 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 description:

The organizer field does not contain the SMTP address when retrieving using ExchangeService.FindAppointments, but this occurs when retrieving using ExchangeService.BindToItems or Appointment.Bind.

+1
source

I had the same problem and managed to populate the Organizer.Address property using the following:

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

the destination element has a property that is Organizer.Address

therefore, if you have assigned a destination variable called a destination, the following code gets the address of the organizer

 Var address = appointment.Organizer.Address; 

Try using this code.

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

Source: https://habr.com/ru/post/922203/


All Articles