exchangewebservices

SOAP Message to EWS to create mail as regular mail, not draft

ぐ巨炮叔叔 提交于 2019-12-02 02:32:02
In EWS, you can create a draft like this: <tns:CreateItem MessageDisposition="SaveOnly"> <tns:Items> <t:Message> <t:ItemClass>IPM.Note</t:ItemClass> <t:Subject>subject</t:Subject> <t:Body BodyType="HTML">body</t:Body> <t:IsRead>false</t:IsRead> </t:Message> </tns:Items> </tns:CreateItem> What do I need to add to create a regular message instead of a draft, as the code above does (using SOAP messages, not the Managed API)? Setting the extended MessageFlags property did the trick! Has to be done at creation. <tns:CreateItem MessageDisposition="SaveOnly"> <tns:Items> <t:Message> <t:ItemClass>IPM

Bind custom extended property for existing appointment using EWS managed API 2.0

送分小仙女□ 提交于 2019-12-02 00:48:48
I want to make unique appointment to put in database using custom extended properties. I find all appointments using FindAppointments(): var appointments = _service.FindAppointments(WellKnownFolderName.Calendar, calendarView); and than i go trough all appointments using foreach loop: foreach (var appointment in appointments) for all appointments which doesn't have extended property: if (appointment.ExtendedProperties.Count <= 0) i bind a custom extended property and setting its value with unique meeting id (meetingId) which i specialy generated to be uniqe int number: var myPropertySetId = new

EWS-managed: Fetch required and optional attendees of appointments

依然范特西╮ 提交于 2019-12-01 21:33:37
As far as I am now, I know how to fetch appointments from exchange server, BUT as soon as I want to see the required and optional attendees, these fields are empty ... I checked the appointment trice and there is an attendee, except me. Do I have to config Outlook differently or do I miss something? List<Appointment> listOfAppointments = new List<Appointment>(); CalendarFolder cfolder = CalendarFolder.Bind(MyService, WellKnownFolderName.Calendar); CalendarView cview = new CalendarView(from.ToUniversalTime(), to.ToUniversalTime()); cview.PropertySet = new PropertySet(ItemSchema.Subject); cview

Exchange Impersonation in Service Account: Autodiscover service couldn't be located

人走茶凉 提交于 2019-12-01 21:27:34
Sending a simple email through ews is working as intended - from my account to my account: ExchangeService ews = new ExchangeService(ExchangeVersion.Exchange2010); ews.AutodiscoverUrl("myname@mydomain.com"); EmailMessage email = new EmailMessage(ews); email.ToRecipients.Add("myname@mydomain.com"); email.Subject = "HelloWorld"; email.Body = new MessageBody("This is the first email I've sent by using the EWS Managed API"); email.Send(); Simply trying impersonation, it is also working as intended - in the last line, it returns the error that I am not allowed to impersonate: ExchangeService ews =

How to set the contact title using Exchange Web Services Managed API

自古美人都是妖i 提交于 2019-12-01 21:04:27
问题 I'm trying to create a new contact using the EWS API. I can set all the values i needed except the contact title property. I tried the code: oContact = new Contact(oService); oContact.GivenName = "John"; oContact.Surname = "Doe"; oContact.Displayname = oContact.Surname; // set the title property as extended property // reference: http://msdn.microsoft.com/en-us/library/gg274394.aspx ExtendedPropertyDefinition oTitleProp = new ExtendedPropertyDefinition( new Guid("{00062004-0000-0000-C000

Name of Version property in ServerVersionInfo element for Exchange Server 2016?

有些话、适合烂在心里 提交于 2019-12-01 20:57:16
问题 With Exchange Server 2016 being available for some time (as of 15. March it's at 2016 CU1), I want to properly detect the Version that gets returned in the SOAP header of each Exchange Web Services response message: <ServerVersionInfo MajorVersion="" MinorVersion="" MajorBuildNumber="" MinorBuildNumber="" Version="" /> The latest schema version mentioned in e.g. the 'EWS schema versions in Exchange' page is Exchange2013_SP1 . What is the name returned for Exchange 2016? I do not yet have an

TimeZone change to UTC while updating the Appointment

别说谁变了你拦得住时间么 提交于 2019-12-01 20:11:21
I am using EWS 1.2 to send appointments. On creating new Appointments, TimeZone is showing properly on notification mail, but on updating the same appointment, it's TimeZone reset to UTC. Could anyone help me to fix this issue? Here is sample code to replicate the issue: ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1, TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")); service.Credentials = new WebCredentials("ews_calendar", PASSWORD, "acme"); service.Url = new Uri("https://acme.com/EWS/Exchange.asmx"); Appointment newAppointment = new Appointment

TimeZone change to UTC while updating the Appointment

南笙酒味 提交于 2019-12-01 19:30:48
问题 I am using EWS 1.2 to send appointments. On creating new Appointments, TimeZone is showing properly on notification mail, but on updating the same appointment, it's TimeZone reset to UTC. Could anyone help me to fix this issue? Here is sample code to replicate the issue: ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1, TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")); service.Credentials = new WebCredentials("ews_calendar", PASSWORD, "acme");

Download attachment from Exchange using Exchange Web Services

孤人 提交于 2019-12-01 16:53:30
I am trying to use the following code to connect and download an attachment from email in an inbox using C# and Exchange Web Services but I am getting a 'System.ArgumentOutOfRangeException' error and I cant see why. I have googled for an answer but i cant find one or the answers I find are for very old versions of EWS. I know that the rest of the code generally works as I can access other information relating to the email, just not access the attachment. Cany anyone show me the error of my ways? Thanks in advance, James static void Main(string[] args) { ExchangeService service = new

Exchange Web Service managed, get deleted appointments

限于喜欢 提交于 2019-12-01 16:32:31
I am about to write a ews-application to connect exchange with another calendar programm. What occured to me, how do I get to know, which appointments get deleted on exchange? Is there a way to tell? I couldn't find it in the API and documentation. Thanks in advance. Depending on how a user deletes an appointment (or any item), different things are done: Soft-Delete: The item is moved to the recycle bin of the mailbox. Hard-Delete: The item is instantly removed. You have multiple ways to get information about deleted items: Query the folder using a FindItems call and select ItemTraversal