Reputation: 7444
Has anyone had an issue with EWS (Exchange 2010 SP1) where the email attachments collection is empty?
The email has 5 attachments (some .tif and some .pdf). My code looks something like like:
if (email is EmailMessage && email.HasAttachments)
{
foreach (Attachment attachment in email.Attachments)
{...
Is there something obvious that I'm missing?
Upvotes: 2
Views: 1017
Reputation: 7444
There was something obvious: apparently I need to bind the message before I can access the attachments.
EmailMessage message = EmailMessage.Bind(service, email.Id, new PropertySet(BasePropertySet.FirstClassProperties, EmailMessageSchema.Attachments));
Upvotes: 6