How to download mail in different format using Microsoft Exchange Web Services Managed API 2.0?

Environment:  -

Exchange Server: - Exchange Server 2010 SP3

EWS API: - 2.0

IDE: - Visual Studio 2008

Language: - C#

.

Requirement: -

.

We are designing a C# based exe utility, which will download mail in following format: -

1- HTML

In case of HTML, following are the possibilities: -  

.

      i- Separate attachment with mail body

    Task: - If Attachments are separate, then we need to dump attachments in some folder and maintain body as body.html

.

      ii- Embed attachment with mail body

    Task: - If Attachments are embedding, and then we need to dump attachments and body as body.mht

.

     iii- Embed attachment within mail body, and also having separate attachment in mail

   Task: - Separate attachments will be saved in some folder and embed attachment, message body will be saved as body.mht

.

2- Plain Text

    i- Separate attachment with mail body

  Task: -Separate attachment will be saved in some folder, and body will be saved as body.txt

.

.

Following challenges, we are facing in development: -

Q: - How will we know Attachments are coming separate, Embed or both?

.

Q: - If attachments are Embed in body, then how will we save body as mht?

.

Kindly assist, I will be really thankful.



  • Edited by S.P Singh Saturday, August 01, 2015 4:15 PM Formatted properly
August 1st, 2015 10:30am

1. Check the property on the Attachment https://msdn.microsoft.com/en-us/library/office/dd633665(v=exchg.80).aspx itself. Depends what you mean by embedded do you mean Exchange Store types ? these are called ItemAttachments in EWS.

2. see https://msdn.microsoft.com/en-us/library/office/dn672317(v=exchg.150).aspx which has a sample of saving a message as an MHT file.

Cheers
Glen

Free Windows Admin Tool Kit Click here and download it now
August 2nd, 2015 10:55pm

Thanks Sir,

      I have gone through first link and found two terms File Attachment and Item Attachment. It seems to me that 

"File attachment is any file and the item attachment is an exchange element like an appointment"

What else comes in category of Item Attachments?

August 3rd, 2015 1:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics