Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: what determines IsInline attachment Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
mnoreen
Newbie
Newbie


Joined: 17 July 2012
Location: United States
Online Status: Offline
Posts: 19
Posted: 17 April 2020 at 12:10pm | IP Logged Quote mnoreen

Hello - My question is related to the Attachment IsInline property.

I have code that loops through the attachment collection of an email message and saves, then removes, attachments that are NOT inline based on that property.

I have found a lot of "mixed" results, however. For example, I have an email loaded from an .eml file. When I open that .eml file in Outlook, the image files are displayed as external attachments (not rendered in the body). Yet, when I iterate over that same .eml file w/ Mailbee code, it shows each attachment as inline. Also, if I try to display that .eml file with the message GetHtmlWithBase64EncodedRelatedFiles() method, it does NOT display the inline attachments. So there seems to be a mix up there of sorts.

Is there anything else that can be done to determine that these attachments are really "external" vs "internal"?
Back to Top View mnoreen's Profile Search for other posts by mnoreen
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 17 April 2020 at 12:50pm | IP Logged Quote Alex

Hello,

Attachment can be inline regardless of whether it's present in HTML body or not. A message can even have no HTML body at all. "Inline" just means this attachment must be rendered. Should it be rendered within the body or side-by-side, that's another question. If the attachment has Content-ID, this usually means this Content-ID is referenced somewhere in HTML body. GetHtmlWithBase64EncodedRelatedFiles only processes inline attachments which are referenced in the body. As for other inline attachments (without Content-ID), you can display them, like, below the main HTML of the message.

So, you can assume that there are 3 categories:
- real attachments (not rendered in any way)
- inline attachments which are not referenced in the body (usually they don't have Content-ID)
- inline attachments referenced in the body (by their Content-ID)

Sometimes the border between these categories is blurry, but this is the nature of email - it's not a strict standard like XML. For instance, inline attachment can be referenced by its filename and have Content-ID header missing. But this shouldn't be a big issue - in this case you'll just display it twice - as part of the message body and separately, below the message body. Not perfect but still no big deal.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide