Search The ForumSearch   RegisterRegister  LoginLogin

MailBee Objects

 AfterLogic Forum : MailBee Objects
Subject Topic: ImportBodyText inline image problem 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: 09 June 2008 at 4:28am | IP Logged Quote iconbill

Hello, here I am again

I have problems importing HTML files when the HTML image source is written like:

<img src="file%20with%20spaces.jpg" />

This kind of images are not included as inline images.

When the html source is like this:
<img src="file with spaces.jpg" />
or this:
<img src="file_without_spaces.jpg" />
then there are no problems, and the images is inline added just fine.

Maybe there are more scenario's where this problem will happend, i'm not sure.

Hope to hear from you soon.

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: 09 June 2008 at 5:06am | IP Logged Quote Alex

ImportBodyText can import only local resources. Internet filenames are not supported (even if they lead to local resources). The same way "file:///path" names won't be detected too. Importing resources from the web (as well as importing resources with web-like names) is supported in MailBee.NET Objects only.

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: 09 June 2008 at 6:04am | IP Logged Quote iconbill

Hello,

I already know it's only possible to import local images.

But I am importing a local html ánd a local image. So this is working: '<img src="file with spaces.jpg" />'.

But strange enough this is NOT working: '<img src="file%20with%20spaces.jpg" />'

When I open the HTML file in a browser, he will display both images.

I could replace every '%20' with a real space and save the HTML again, but it would be much faster if your component could also handle the space code '%20'.
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: 09 June 2008 at 6:20am | IP Logged Quote Alex

Things are not so simple. %20 can appear in filenames as well (% is a valid character in filenames). The idea is that %20 means space in URLs while ImportBodyText accepts filenames, not URLs.

For instance, if you have file with name IncreaseSalesBy%20.jpg, it won't be attached properly if the code converted %20 to space on its own.

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: 09 June 2008 at 7:17am | IP Logged Quote iconbill

Thank you for the fast and clear response.

ps: My fix: I will remove all spaces from the uploaded images.
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: 11 June 2008 at 2:31am | IP Logged Quote iconbill

Is it also possible for change the body html , AFTER the file is imported with embeded pictures?

Because in the worst case, the linked image in the html could not be found, so the link is not replaced with an id. So this could mean the receiver see a full path to the image in the source of the html, like 'c:\temp\image.jpg'

I want to remove all 'c:\temp' after the body html imported.

Thank you for your help.

Kind regards,
Marco
Back to Top View iconbill's Profile Search for other posts by iconbill
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 11 June 2008 at 4:01am | IP Logged Quote Andrew

Yes, ImportBodyText method just imports body and attachments and you're able to do with the message anything after that.

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


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 11 June 2008 at 6:05am | IP Logged Quote iconbill

That is great! I succesfully imported the html with inline images and updated the body text before send. Perfect! :)
Back to Top View iconbill's Profile Search for other posts by iconbill
 

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