Questions tagged [ews-managed-api]

Exchange Web Services (EWS) API that can be used to access Exchange resources.

Microsoft Exchange Server 2007 introduces Exchange Web Services (EWS), a API that can be used to access Exchange resources. EWS is a SOAP-based XML Web service that can be accessed remotely from any operating system and any language that can send requests over HTTPS.

Creating a new folder in the Inbox

Folder folder = new Folder(service); folder.DisplayName = "My new folder"; folder.Save(WellKnownFolderName.Inbox);

Creating and saving a draft e-mail message

EmailMessage message = new EmailMessage(service); message.Subject = "Hello from the EWS Managed API"; message.Body = "Now that's easy!"; message.ToRecipients.Add("someone@fabrikam.com"); message.Save();

370 questions
3
votes
0 answers

How to transfer emails with attachments from one mailbox to another using Exchange Web Service or EWS Managed API?

I'm working on a small application in which we need to transfer mailbox emails, contacts, etc from one mailbox to another. Our emails have attachments also. As per Microsoft EWS documentation the best method to export/import from exchange server to…
3
votes
2 answers

Using Exchange managed api (EWS) to monitor mailbox attachments

I plan on creating a windows service that will monitor an exchange mailbox for mails with particular subject. The attachments from such emails need to be stored in a specific folder on the network share. I believe I can achieve this using Exchange…
Pratik Kothari
  • 2,446
  • 2
  • 32
  • 54
3
votes
1 answer

What are the allowable extra query parameters for AcquireTokenAsync

What are the extra query parameters allowed in the extraQueryParameters parameter of AcquireTokenAsync?
3
votes
1 answer

How can I set MHT-body for mail sending through Exchange Server?

I have a message as an MHT-File. Now I am searching for a way to set this for a mail to send through Exchange Server (with Exchange Web Service). When I set it as a MIME-Content, the parts (picture and text) will be attached as attachments (JPEG…
3
votes
0 answers

EWS Managed API ExtendedProperty PidLidResponseStatus gives String instead of integer like it is defined

Since Exchange 2016, the extended property PidLidResponseStatus gives Strings. But it is defined as MapiPropertyType.Integer: Here is how it is defined: ExtendedPropertyDefinition PidLidResponseStatus = new…
Sven Ilius
  • 71
  • 5
3
votes
0 answers

SQL CLR - Exchange Web Services Managed API 2.2 not loading dependant assemblies

I am attempting to use the EWSMA 2.2 with my SQL Server 2016 (v 13.0.2164.0) to connect to an Exchange server 2010. The code I've written works perfectly as a console app, but when I try to turn it into a SQL CLR Assembly, it fails at runtime with…
3
votes
1 answer

Exchange Web Services: Batching with FindItemsResult

I'm writing an app to process email attachments, using Exchange Web Services. The general structure of my problem area is as follows: public static void Main() { FindItemsResults findResults = FindItems(); foreach (Item item in…
CJM
  • 11,908
  • 20
  • 77
  • 115
3
votes
2 answers

EWS Set EmailMessage.Body.Text error

I have the following code to simply add text to an email: msg = New EmailMessage(Service) With msg .From = New EmailAddress(Config("OutSender")) .ToRecipients.Add(New EmailAddress(Config("OutRecip"))) .Subject = Config("OutSubject") …
JabbaWook
  • 677
  • 1
  • 8
  • 25
3
votes
1 answer

Cross folder searching of Exchange using Exchange Web Services

Is there a way to search Exchange using the EWS Managed API for all email messages across ALL folders. I'm using the FindItems API call -- but that appears to require that the search be confined to a single folder. private void…
3
votes
1 answer

Exception when subscribing to exchange streaming notifications

I'm currently working on a project that has me integrating with Exchange. One of the requirements is to monitor mailboxes for new incoming messages and I thought that leveraging a streaming notifications would be a good idea. I wrote a sample…
Tombatron
  • 1,567
  • 1
  • 13
  • 27
3
votes
0 answers

Save an Exchange mailitem to the filesystem local to the Exchange Server using EWS?

It's my first question/post :-/ Background to question:- I have an ongoing project which is an Azure hosted ASP.NET solution. Its a generic ERP and is intended for small enterprise businesses. An additional requirement came up and I'd like it to be…
Jon
  • 190
  • 2
  • 15
3
votes
1 answer

Get unread email and mark as read in one call using EWS Managed API

I have a standard routine to get an unread email from a mail server, mark it as read and then process it. It looks similar to this: var view = new ItemView(1); SearchFilter sf = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new…
Jacek Glen
  • 1,506
  • 12
  • 14
3
votes
2 answers

Due Date set via EWS is wrong in reminder popup

I'm having some trouble using EWS with tasks and reminders, specifically, the due date. When I run my code, shown below, the task is added to my exchange account and I can see it fine in outlook. All the data in it looks fine too. However, if I…
3
votes
2 answers

EWS Search Appointments by Subject

I'm using EWS Managed API 2.0. I would like to be able to search a calendar in exchange on the subject of the appointment in the future. The caveats are: only return future appointments matching the subject="test" only return future appointments…
Fraze
  • 908
  • 2
  • 8
  • 20
3
votes
0 answers

Calling EWS services through Managed API by using Oauth (ADAL azure active directory library) 401 Unauthorized

I am developing a Provider hosted app in sharepoint for calling EWS services. I am using managed api. below is my code, ClientCredential cc = new ClientCredential("********-****-****-****-********e042",…