Email Attachment Not Found?

The following is a list of the most common mistakes made when expecting to find an attachment in an email object:

  1. You downloaded headers-only.  If you call a method to download only the headers of an email, then the attachments will not be included.  With IMAP you will still get information about the attachments, but with POP3 you will not get them at all.  See this blog post about POP3 email headers and attachment info.
  2. What you are expecting to see as an attachment is actually a “related item”.  A related item is an image, style sheet, etc. that is part of the HTML presentation.  It is an embedded item that is referenced by the HTML body of an email and is not a formal attachment.  You’ll find a complete set of properties and methods for related items:  NumRelatedItems, GetRelatedData, SaveRelatedItem, etc.
  3. It is an “attached message”.  Similar to related items, a complete email that is attached to another email is considered separately by Chilkat.  The property is NumAttachedMessages.  To get the Nth attached message, call GetAttachedMessage(index).  this returns a new email object that is the Nth attached message.
  4. It is an attachment found within an attached message.  You would first need to get the attached message and then you’ll see the attachments within it.