Search The ForumSearch   RegisterRegister  LoginLogin

MailBee Objects

 AfterLogic Forum : MailBee Objects
Subject Topic: GetBodyWithEmbeddedObjectsEx Problems Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 13 November 2008 at 2:34am | IP Logged Quote iconbill

Problem:

Some received emails does have attachted INLINE images but without a Content-ID in the html-source. They just have an image name as source. Conlusion, the images are not displayed with 'GetBodyWithEmbeddedObjectsEx' (mail example source code ...see below)

I do not know if these messages are 100% valid / correct, but Outlook and Hotmail can read this kind of mails without any problem.

note: I know ASP Smart mail is sending mails like this.   

Even if the orginal message code is invalid, I need a sollution :)


EXAMPLE PROBLEM EMAIL WITH 'GetBodyWithEmbeddedObjectsEx'


<img src="justaimage.gif">

----------------BoundaryAF24BE14CD
Content-Type: application/octet-stream; name="justaimage.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="justaimage.gif"

etc...
Back to Top View iconbill's Profile Search for other posts by iconbill
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 13 November 2008 at 6:13am | IP Logged Quote Igor

We've tried to open a message with inline attachment formatted according to your example, but Outlook Express and Mozilla Thunderbird fail to display inline attachment in it.

We can recommend you the following workaround: use GetBodyWithEmbeddedObjectsEx method with the message, scan the resulting message for inline attachments which were not saved to save them manually and replace paths in the HTML code.

Regards,
Igor
Back to Top View Igor's Profile Search for other posts by Igor
 
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 13 November 2008 at 6:23am | IP Logged Quote iconbill

Hi Igor,

You can try it in Outlook 2003 and Hotmail.com , you will see it will display the images.

I am going to try your workaround now.
Back to Top View iconbill's Profile Search for other posts by iconbill
 
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 13 November 2008 at 7:22am | IP Logged Quote iconbill

Hi again,

There are a lot of disadvantages to the given workarround:

- we have to loop (again) true attachment collection
- extra check needed for only inline attachemts for only images
- i have to use the very slow ASP filesystem object
- i have to use string replace function (or regexp)


It would be a lot easier for us if the GetBodyWithEmbeddedObjectsEx would do this for us... It's a lot of work to check this for each and every inline image.

If that isn't a option for you guys, maybe the componenten can return a list of inline images that have been processed so we don't have to use filesystem object and other checks.

Kind regards,

Marco
Back to Top View iconbill's Profile Search for other posts by iconbill
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 13 November 2008 at 11:17am | IP Logged Quote Alex

This ASP snippet shows all links to non http (external images) or cid (correctly defined internal images) URLs in IMG tags.

All these images will be processed correctly by GetBodyWithEmbeddedObjectsEx. Other images will be not.

You'll need MessageCensor component for this.

Code:

Set Msg = CreateObject("MailBee.Message")

Msg.BodyText = "<img src='aa.gif'> <img src='cid:zzz'> <img src='http://url'>"

' The actual code starts here
Set Censor = CreateObject("MC.MessageCensor")
Censor.UnsafeProtocols = "http|cid"
Censor.AddUnsafeTag "IMG", 2, "SRC"
Censor.EnableReport = True
Censor.Filter Msg.BodyText

For I = 0 To (Censor.Report.Count - 1)
  Response.Write Censor.Report(I).Value & " at " & Censor.Report(I).FirstIndex + 1 & "<br>"
Next


Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 17 November 2008 at 6:03am | IP Logged Quote iconbill

Thank you Alex. We used the code and now we can see these images to!

Regards,
Marco
Back to Top View iconbill's Profile Search for other posts by iconbill
 
khushi
Newbie
Newbie


Joined: 14 May 2009
Location: India
Online Status: Offline
Posts: 8
Posted: 14 May 2009 at 11:38pm | IP Logged Quote khushi


When I get mail with picture insert(not as attachment!) I get missing pic in the spot of the pic in the bodytext.

Is there any way to get mail complete text+picture?

for eg.
currently i am getting following line instead of picture:
(Embedded image moved to file: pic29658.jpg)

Please suggest the possible solution.
Back to Top View khushi's Profile Search for other posts by khushi
 
khushi
Newbie
Newbie


Joined: 14 May 2009
Location: India
Online Status: Offline
Posts: 8
Posted: 14 May 2009 at 11:41pm | IP Logged Quote khushi

I have also used the function "GetBodyWithEmbeddedObjectsEx" but it is not working.
Back to Top View khushi's Profile Search for other posts by khushi
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 15 May 2009 at 3:10am | IP Logged Quote Igor

MailBee Objects documentation includes tutorials regarding handling inline attachments for Visual Basic and ASP.

If this doesn't work for you for some reason, you can request help from AfterLogic Support staff. Please submit your request via our HelpDesk, attach EML file of the message you're trying to process and include the code you're using for this.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
khushi
Newbie
Newbie


Joined: 14 May 2009
Location: India
Online Status: Offline
Posts: 8
Posted: 15 May 2009 at 4:13am | IP Logged Quote khushi

Hi Igor,

I have submit my request to HelpDesk.
Thanks for the support.
If you come across anything then let me know.
Back to Top View khushi's Profile Search for other posts by khushi
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 18 May 2009 at 1:22am | IP Logged Quote Igor

We have responded you on this in our Helpdesk. As it looks like you didn't receive the response notification, we post the same response here as well.

We have used the example from ASP tutorial. We've modified it a bit: the script below retrieves the last message from POP3 server and displays it as HTML with inline attachments shown as images.

Code:
<%
Dim objPOP3, objMsg
Set objPOP3 = Server.CreateObject("MailBee.POP3")
objPOP3.LicenseKey = "trial or permanent license key"

If objPOP3.Connect("mailserver.com", 110, "user@mailserver.com", "password") Then

  If objPOP3.MessageCount > 0 Then

    Set objMsg = objPOP3.RetrieveSingleMessage(objPOP3.MessageCount)

    Response.Write _
      objMsg.GetBodyWithEmbedd edObjectsEx("C:\web\test\inline\temp",  _
      "http://localhost/test/i nline/temp", , 1)
  End If

  objPOP3.Disconnect
Else
  Response.Write objPOP3.ErrDesc
End If
%>


This should work just fine with either 1 or 2 set for PathBuildingMode. If this doesn't work for you, please provide us with EML file of a message you're trying to process. Modify the above code by adding a line:

Code:
Set objMsg = objPOP3.RetrieveSingleMessage(objPOP3.MessageCount)
objMsg.SaveMessage "C:\web\test\inline\temp\saved.eml"


Be sure to specify a valid path for your environment.

Please note that the email address you specified in Helpdesk doesn't seem to be valid, so we've also sent a copy of this to email address you used on our forum.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
khushi
Newbie
Newbie


Joined: 14 May 2009
Location: India
Online Status: Offline
Posts: 8
Posted: 20 May 2009 at 10:57pm | IP Logged Quote khushi

I am using IMAP4 instead of POP3.
Is this is creating problem?
Back to Top View khushi's Profile Search for other posts by khushi
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 20 May 2009 at 11:05pm | IP Logged Quote Andrew

No matter whether you use POP3 or IMAP. GetBodyWithEmbeddedObjectsEx has nothing to do with either POP3 or IMAP. You can load message from disk, obtain from a database, download through POP3 or IMAP, the result would be the same.

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


Joined: 14 May 2009
Location: India
Online Status: Offline
Posts: 8
Posted: 21 May 2009 at 2:50am | IP Logged Quote khushi

Hi from this code also i am not getting the picture.

I have attached the email that i am trying to retrieved through mailbee in HeplDesk.

Plese have a look at it.

Back to Top View khushi's Profile Search for other posts by khushi
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 21 May 2009 at 3:27am | IP Logged Quote Igor

We've received the file, thank you. However, it has proprietary .MSG format which is not supported by MailBee Objects, only standard .EML format is supported, and we'll need the message in .EML format to be able to reproduce the issue. In MailBee Objects, you can save message using SaveMessage method.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
khushi
Newbie
Newbie


Joined: 14 May 2009
Location: India
Online Status: Offline
Posts: 8
Posted: 03 June 2009 at 1:32am | IP Logged Quote khushi

On saving message as .eml then also picture is not coming.
Back to Top View khushi's Profile Search for other posts by khushi
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 03 June 2009 at 1:40am | IP Logged Quote Igor

Can you submit the file via HelpDesk? Thank you.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
khushi
Newbie
Newbie


Joined: 14 May 2009
Location: India
Online Status: Offline
Posts: 8
Posted: 15 June 2009 at 2:07am | IP Logged Quote khushi

Hi Igor,

I have send the .eml file to you via HelpDesk
but after saving it with .eml nothing can be viewed.

Regards,
Khushbu.
Back to Top View khushi's Profile Search for other posts by khushi
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 15 June 2009 at 2:17am | IP Logged Quote Igor

We've received the file, thanks.

Even though the file has .eml extension, it's not EML file by its structure but a HTML file. And as such, it certainly does not contain any inline images attached.

With regard to sending messages with inline attachments, the following tutorials should be helpful to you:

Embedding images and files

HTML e-mail from a file

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

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