Insert contents of HTML file into Outlook body (1 Viewer)

chuckcoleman

Registered User.
Local time
Today, 17:28
Joined
Aug 20, 2010
Messages
363
I have a HTML file, “Trip Report-Email.html”, that I would like to insert into the body of an Outlook email message. The html file, “Trip Report-Email.html” is generated by exporting an Access report to an html file. When the email gets sent, I want the email recipient to see in the body of the email the report. To be clear, I want the report displayed in the body of the email message looking just like it would if you had clicked on the html file. I don't want a link and I don't want an attachment.

Right now, the Subject and the text in the Body all work perfectly. What I’m having trouble with is taking the html file above and inserting it.

Is there any sample code or suggestions that I can take a look at to accomplish this?

I appreciate any help on this topic.

Thanks,

Chuck
 

Micron

AWF VIP
Local time
Today, 18:28
Joined
Oct 20, 2018
Messages
3,478
I have created html email body text to report record details simply by making all the html tags and content as part of the body. Would think you could do the same for your file content. Note that I'm not saying you can simply dump

<html><head><body>TEST</body></head></html>

and expect it to work. You build the entire email message object in code.
EDIT - should mention that I was using CDO to send the message but that probably doesn't matter. It's the building of the message body that is the trick.
 

Mark_

Longboard on the internet
Local time
Today, 15:28
Joined
Sep 12, 2017
Messages
2,111
How are you sending the Email now? What's the code?

If it is something that support HTML, you can loop through your record source to create the body as Micron has indicated. If it doesn't, you may have to change how you are doing it.
 

Users who are viewing this thread

Top Bottom