SaveHTMLEx - html use with Outlook
-
- Posts: 104
- Joined: Mon Nov 26, 2007 1:49 pm
SaveHTMLEx - html use with Outlook
Hello,
I'm exporting in our application Richview Data to HTML like the following Code :
rv.RichView.SaveHTMLEx(sFile, '', 'image', '', '', '', [rvsoUseItemImageFileNames, rvsoOverrideImages, rvsoForceNonTextCSS]);
The html contains Images, which are saved in separated files. The Internet Explorer and the Google Chrome Shows the Images without Problems.
But Outlook Shows only empty shapes.
If I'm using absolute path for the Images then Outlook Shows on my Computer also the Images, but if I'm sending the mail then the receiver has only a red X and there is a text that the Image can't be foun (wrong Directory).
What have I to do that the Images are shown on the Sender Computer and on the receiver Computer? It is ok for me, if the receiver have to download the Image.
Best wishes
Bernhard
I'm exporting in our application Richview Data to HTML like the following Code :
rv.RichView.SaveHTMLEx(sFile, '', 'image', '', '', '', [rvsoUseItemImageFileNames, rvsoOverrideImages, rvsoForceNonTextCSS]);
The html contains Images, which are saved in separated files. The Internet Explorer and the Google Chrome Shows the Images without Problems.
But Outlook Shows only empty shapes.
If I'm using absolute path for the Images then Outlook Shows on my Computer also the Images, but if I'm sending the mail then the receiver has only a red X and there is a text that the Image can't be foun (wrong Directory).
What have I to do that the Images are shown on the Sender Computer and on the receiver Computer? It is ok for me, if the receiver have to download the Image.
Best wishes
Bernhard
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Images must be embedded in email together with HTML.
Normally, email clients use MIME email format for HTML emails.
We have examples how to send HTML email from Delphi application:
http://www.trichview.com/forums/viewtopic.php?t=11 (using Indy)
http://www.trichview.com/forums/viewtopic.php?t=4123 (using CleverComponents)
But sorry, I cannot make suggestions how to do it in a specific email client. I am sure there is a way to insert an image in email directly instead of a link to a file, but I do not know if Outlook supports it for images imported from an external HTML.
Normally, email clients use MIME email format for HTML emails.
We have examples how to send HTML email from Delphi application:
http://www.trichview.com/forums/viewtopic.php?t=11 (using Indy)
http://www.trichview.com/forums/viewtopic.php?t=4123 (using CleverComponents)
But sorry, I cannot make suggestions how to do it in a specific email client. I am sure there is a way to insert an image in email directly instead of a link to a file, but I do not know if Outlook supports it for images imported from an external HTML.
-
- Posts: 104
- Joined: Mon Nov 26, 2007 1:49 pm
Thanks for your answer.
But if I'm exporting a Report (which contains Richview Components) with eDocEngine, it works, although the Image files are separated files. But eDocEngine has other Problems, so I want to use the html Export of TRichview.
The difference of eDocEngine and TRichview is the following :
eDocEngine :
<div style="position: absolute; top: 2px; left: 5px; width: 151px; height: 151px;"><img style="position: absolute; top: 41px; left: 75px; width: 148px; height: 148px;" src="file://C:\Users\ROOS~1.SUN\AppData\Local\Temp\zeitarbeitdeluxe\20151102133548852_92656631\ReportBuilder.HTML_1_I.jpg" alt="" ></div>
RichView :
<p><img width=149 height=149 alt="" src="C:/Users/ROOS~1.SUN/AppData/Local/Temp/zeitarbeitdeluxe/20151102132158568_96100290/image1.jpg"></p>
The path is difference because this are only temp directories but the main difference is that in eDocEngine the path Begins with file:// and then it uses back slashes for the path. In TRichview it uses only slashes for the path and the file:// is missing.
I want to try if this makes a difference for Outlook. But I don't know what is to do that TRichview wites the imagepath in the same way.
Best wishes
Bernhard
But if I'm exporting a Report (which contains Richview Components) with eDocEngine, it works, although the Image files are separated files. But eDocEngine has other Problems, so I want to use the html Export of TRichview.
The difference of eDocEngine and TRichview is the following :
eDocEngine :
<div style="position: absolute; top: 2px; left: 5px; width: 151px; height: 151px;"><img style="position: absolute; top: 41px; left: 75px; width: 148px; height: 148px;" src="file://C:\Users\ROOS~1.SUN\AppData\Local\Temp\zeitarbeitdeluxe\20151102133548852_92656631\ReportBuilder.HTML_1_I.jpg" alt="" ></div>
RichView :
<p><img width=149 height=149 alt="" src="C:/Users/ROOS~1.SUN/AppData/Local/Temp/zeitarbeitdeluxe/20151102132158568_96100290/image1.jpg"></p>
The path is difference because this are only temp directories but the main difference is that in eDocEngine the path Begins with file:// and then it uses back slashes for the path. In TRichview it uses only slashes for the path and the file:// is missing.
I want to try if this makes a difference for Outlook. But I don't know what is to do that TRichview wites the imagepath in the same way.
Best wishes
Bernhard
-
- Posts: 104
- Joined: Mon Nov 26, 2007 1:49 pm
Now, I find the real difference. Please Forget my previous post.
Richview makes the following line :
<p><img width=149 height=149 alt="" src="d:/roostest/image1.jpg"></p>
This don't work with Outlook.
The following line works with Outlook :
<div><img style="width: 148px; height: 148px;" alt="" src="file://d:\roostest\image1.jpg"></div>
Is there a way that I can Change this line in my program? Sure I could parse the html, but perhaps there is a more simple way (I hope).
Best wishes
Bernhard
Richview makes the following line :
<p><img width=149 height=149 alt="" src="d:/roostest/image1.jpg"></p>
This don't work with Outlook.
The following line works with Outlook :
<div><img style="width: 148px; height: 148px;" alt="" src="file://d:\roostest\image1.jpg"></div>
Is there a way that I can Change this line in my program? Sure I could parse the html, but perhaps there is a more simple way (I hope).
Best wishes
Bernhard
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 104
- Joined: Mon Nov 26, 2007 1:49 pm
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
If this is really so, it is a bug in Outlook.
1) <img>'s width and height are perfectly valid attributes, they are not even marked as "deprecated" in HTML specification
2) backslashes cannot be used in URL, the URLs like "file://d:\roostest\image1.jpg" are invalid.
The valid URL is file:///d:/roostest/image1.jpg (triple slash after file:)
1) <img>'s width and height are perfectly valid attributes, they are not even marked as "deprecated" in HTML specification
2) backslashes cannot be used in URL, the URLs like "file://d:\roostest\image1.jpg" are invalid.
The valid URL is file:///d:/roostest/image1.jpg (triple slash after file:)
-
- Posts: 4
- Joined: Mon Aug 08, 2016 2:49 pm
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Actually, local links to images are useless in emails (unless you send your HDD together with email ). In HTML email, you can:
- refer to images on http server
- embed image directly in HTML (see http://www.trichview.com/forums/viewtopic.php?t=7191 )
- (recommended way) encode HTML and images in message using MIME (I believe Outlook uses the same format of HTML). It is implemented for CleverComponents in http://www.trichview.com/forums/viewtopic.php?t=4123
See also my answer in
http://www.trichview.com/forums/viewtopic.php?t=7191
- refer to images on http server
- embed image directly in HTML (see http://www.trichview.com/forums/viewtopic.php?t=7191 )
- (recommended way) encode HTML and images in message using MIME (I believe Outlook uses the same format of HTML). It is implemented for CleverComponents in http://www.trichview.com/forums/viewtopic.php?t=4123
See also my answer in
http://www.trichview.com/forums/viewtopic.php?t=7191