locked
[E2010SP1] How to get the sender address of an item attachment using EWS? RRS feed

  • Question

  • Hi,

    I'm new to the EWS API but I've managed to do most things that I needed except for:

    1. How to get the sender address from an ItemAttachment?
    2. How to save an ItemAttachment to disk in msg format? I've read other (older) threads that suggest this was not possible but it seems strange that this was missed out of the API?

    If anyone can help with these, thanks.

    Cheers,

    Rob

     





    Wednesday, April 27, 2011 9:23 PM

Answers

  • This was quite easy in the end:

    EmailMessage emtDraft = ia.Item as EmailMessage;

    I can now access the Sender property. It's interesting that ItemAttachment contains most properties such as To, Cc, etc, but not the sender.

    Also, the resultant EmailMessage cannot be used for CreateForward() or CreateReply() and quite a lot of other things, too.

    • Marked as answer by Rob.Ford Monday, May 2, 2011 11:15 PM
    Monday, May 2, 2011 11:15 PM