How to know, if message is having Inline attachments, Separate Attachments or Both kind of attachments using EWS Managed API 2.0 in C#

Environment:  -

Exchange Server: - Exchange Server 2010 SP3

EWS API: - 2.0

IDE: - Visual Studio 2008

Language: - C#

.

Requirement: -

How to know, if message is having following, using EWS Managed API 2.0 in C#

  1. Inline attachments
  2. Separate Attachments
  3. Both kind of attachments

Kindly assist

.

I will be really thankful.

August 3rd, 2015 1:28am

Please see

https://msdn.microsoft.com/en-us/library/office/dd633665(v=exchg.80).aspx

Thanks,
Venkat

Free Windows Admin Tool Kit Click here and download it now
August 3rd, 2015 11:46am

Please see

https://msdn.microsoft.com/en-us/library/office/dd633665(v=exchg.80).aspx

Thanks,
Venkat

August 3rd, 2015 3:45pm

To get a file attachment 

Bind to an existing item by using its unique identifier. The following code shows how to bind to an existing message item, requesting its Id property plus its attachments collection, and provide it with connection configuration information by using an ExchangeService object named service. The ItemId has been shortened to preserve readability.                                                                                                                                                                                                                                                    What is "Bind to an existing item by using its unique identifier"? ItemId("AAMkA") means?                                                                                                                                                                                                                                                                                                                 

EmailMessage message = EmailMessage.Bind(service, new ItemId("AAMkA"), new PropertySet(BasePropertySet.IdOnly, ItemSchema.Attachments));

Free Windows Admin Tool Kit Click here and download it now
August 6th, 2015 5:14am

var inbox = new FolderId(WellKnownFolderName.Inbox);

var iv = new ItemView(10);

var items = service.FindItems(inbox,iv);

int itemsCountInInbox = items.TotalCount;

MessageBox.show("Total emails for processing: " + itemsCountInInbox);

foreach (Attachment attachmentProcess in msg.Attachments)

{                       

     if (attachmentProcess.IsInline == true)

     {

       MessageBox.show (" Inline " + attachmentProcess.Name);

     }

     else

     {

       MessageBox.show (" Separate " + attachmentProcess.Name);

     }

}


  • Marked as answer by S.P Singh 21 hours 56 minutes ago
  • Edited by S.P Singh 21 hours 44 minutes ago IsInline Added
August 6th, 2015 5:34am

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

Other recent topics Other recent topics