Problem with TExtraDevices to HTML w/ image
I'm stuck on one last issue with exporting and emailing my reports using
TExtraDevices. I am trying to support export to HTML, then emailing these. I
don't want to use TXUtils.ExportToMail, as it doesn't support what I need.
However I did learn from the code in there how to determine which image
files were created so i can attach them to my email message.
If I send an email with the report as an HTML file attachment, along with
all images, it works great.
If I send an email with the message body loaded from the HTML file with NO
images, it works great.
But if I try to email with the message body loaded from the HTML file and
there ARE images, the right images do get attached, but the message body
stays in Plain Text format. All the right HTML is there, but Outlook treats
it as a plain text message.
I checked ContentType right before it sends, and it really is Text/Html (I
also tried Multipart/Mixed).
Any ideas what I'm doing wrong? I just need the HTML to show in the
message, rather than as plain text.
Thanks for your time,
Carter M.
TExtraDevices. I am trying to support export to HTML, then emailing these. I
don't want to use TXUtils.ExportToMail, as it doesn't support what I need.
However I did learn from the code in there how to determine which image
files were created so i can attach them to my email message.
If I send an email with the report as an HTML file attachment, along with
all images, it works great.
If I send an email with the message body loaded from the HTML file with NO
images, it works great.
But if I try to email with the message body loaded from the HTML file and
there ARE images, the right images do get attached, but the message body
stays in Plain Text format. All the right HTML is there, but Outlook treats
it as a plain text message.
I checked ContentType right before it sends, and it really is Text/Html (I
also tried Multipart/Mixed).
Any ideas what I'm doing wrong? I just need the HTML to show in the
message, rather than as plain text.
Thanks for your time,
Carter M.
This discussion has been closed.
Comments
ExtraDevices.HTML.BaseURL := 'CID:';
This will change the URL of the images so that the email program will read them.
As for the text issue, check out the SendIndyHTMLMail procedure for the proper
handling of the content types.
James Waler
Waler Ltd
http://www.waler.com