Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: embedded item Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
dvasilakis
Newbie
Newbie


Joined: 27 January 2009
Location: Greece
Online Status: Offline
Posts: 1
Posted: 27 January 2009 at 2:38pm | IP Logged Quote dvasilakis

i try to get an outlook mail with an embedded item in html body and save it as eml. More specific in
html body there is a file with extension .wav.The problem is that i get it as an attachment and in
its place in the html body appears <<...>>.I dont know what to do. The problem is that on my example
theres no contentid for the embedded item.So i dont know how to use msg.Attachments.Add

Below theres the snippet code

msg = New MailBee.Mime.MailMessage()


For Each attach As RDOAttachment In rdoMail.Attachments
     attach.SaveAsFile(Path & attach.FileName)
     If rdoAttachmentType.olEmbeddedItem Then
           msg.Attachments.Add(TemporaryPath & attach.FileName, attach.FileName)
     ElseIf rdoAttachmentType.olByValue Then
           If Not attach.Hidden Then
           msg.Attachments.Add(Path & attach.FileName, attach.FileName)
           Else
           contentID = attach.Fields(PR_ATTACH_CONTENT_ID)
           msg.Attachments.Add(TemporaryPath & attach.FileName, attach.FileName, contentID)
           End If
     End If
Next
Back to Top View dvasilakis's Profile Search for other posts by dvasilakis
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 28 January 2009 at 3:02am | IP Logged Quote Igor

Any file embedded in html message body must have ContentID set for it. In case if ContentID is not available, file is treated as attacment and not as an embedded object.

It looks like the code you provided requires rechecking with regard to its logic and structure. Particularly, the first "If" clause seems to check if the item is embedded, but in fact you process the file as a non-embedded one. Try switching places for the following code blocks:
Code:
msg.Attachments.Add(TemporaryPath & attach.FileName, attach.FileName)
and
Code:
contentID = attach.Fields(PR_ATTACH_CONTENT_ID)
msg.Attachments.Add(TemporaryPath & attach.FileName, attach.FileName, contentID)


Regards,
Igor
Back to Top View Igor's Profile Search for other posts by Igor
 
jvinis
Newbie
Newbie


Joined: 20 May 2008
Online Status: Offline
Posts: 18
Posted: 28 January 2009 at 3:12am | IP Logged Quote jvinis

Sorry if i was mistaken but the mail body is rich text type(rtf) and not html body. So theres no contentid.
Back to Top View jvinis's Profile Search for other posts by jvinis
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 28 January 2009 at 3:37am | IP Logged Quote Andrew

Usually, RTF documents contain all embedded objects inside, i.e. even if an RTF document contains three images, it's still a single file, while HTML documents can't contain embedded objects inside, i.e. an HTML document with three images is HTML file plus 3 image files.

If you're sure the file in question is an object embedded into RTF body, but it's not a part of the RTF document, but an attachment, this is a specific feature of proprietary MS Outlook format.

EML files don't support RTF bodies with external embedded objects. Moreover, most mailers are not able to read messages with RTF bodies. The only way to get it working for sure is to convert the RTF body into HTML format and track all the embedded objects in your application to assign Content-ID to them. As the result, you should get standard EML message with HTML bodies and embedded objects linked by Content-ID. Any popular mailer would be able to read such a message.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 

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