Display HTML in outlook messages

admin

Administrator
Staff member
I have an access database that outputs customer statements. I have written the necessary code to generate HTML code for each statement / customer and can output this HTML into an HTML file and read it like any other web page in a browser.<br />
<br />
I would like to email these pages to my customers as part of a messgae body using Outlook 2000.<br />
<br />
I have successfully managed to create emails containing the Statement HTML as the message body, and sent them to myself, but when I open the emails I get TEXT HTML rather than the formated statement.<br />
<br />
QUESTION: HOW DO I INCLUDE HTML IN AN EMAIL VIA OUTLOOK 2000<br />
<br />
I am using DoCmd.SendObject in Access 97 to create the Outlook 2000 email.<br />
<br />
Many many thanks in advance<!--content-->Hi there ben stevens,<br />
<br />
I am not familiar with 'Outlook 2000'<br />
You can see how it is done in 'Outlook Express'...here (<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=30683">http://www.htmlforums.com/showthread.ph ... adid=30683</a><!-- m -->)<br />
<br />
c:cool::cool:thead<!--content-->Thanks for that, and for replying so quickly ... Unfortunately I don't think it solves my problem. I have about 4000 statements to distribute by email at a time, and managing each one by hand would be prohibitive.<br />
<br />
Do you know how HTML code is identified as such by Outlook(Express)? And thus displayed as a web page rather than text.<br />
<br />
Ben<!--content-->I have about 4000 statements to distribute by email at a time, and managing each one by hand would be prohibitive. <br />
<br />
With that amount of emails to send i would really consider a PERL or PHP script, See if your host supports PERL/CGI or PHP scripting, If so theres a tonne of scripts out there that will do what you need, Like COOT i'm not that familiar with outlook 2000 as well, But i would definatly consider using a script, See what some others say & think about it b4 replying back, Theres many people that could help you locate a script to do it like myself, All the best & welcome to htmlforums... jaeman;)<!--content-->Many thanks ... I have absolutely no experience with PHP scripts or otherwise, but I'll see what I can find out.<br />
<br />
As it turns out, I might just attach the file to an email and send it in the short term.<br />
<br />
Thanks again.<!--content-->sounds like you are not running this on the web. if you are not then php, perl will do you no good.<br />
<br />
you need to cahnge the header in the email to make it html instead of text. I do not know the correct syntax for access databases but in php or perl it is <br />
Content-type: text/html<br />
<br />
and if you are not on the web tehn it is best to make a C or VB program to do what you want.<!--content-->Many thanks .. looks like I might be getting somewhere.<br />
<br />
Is this what you mean?<br />
<HEAD><br />
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=windows-1252"><br />
<TITLE>PenCarrie Statement</TITLE><br />
</HEAD><br />
<br />
The above doesn't work though.<!--content-->no, it is in the header of the email, not the html part.<br />
<br />
so it has to go in the code that is making this and putting it in outlook<!--content-->I see ... I'll have a go.<!--content-->actualy I was just thinking. you said that you have access database generating the code, but you never said anyhting about how it is getting into outlook so you can send it. if you don't have anything then you will have to do it by hand or you would have 4000 emails in teh to field of the email itself.<br />
<br />
best bet is to make something that sends the email automatically without using outlook. is this on a website? or is it local to your machine?<!--content-->This is beginning to sound good... Thanks.<br />
I am generating the Emails locally, using VBA in Access, and sending them to Outlook using DoCmd.SendObject in Access. This function sends an Object (in this case an email) to the default Email Client on the local machine (in my case Outlook). One of the properties of the SendObject function exposes the body of the email to be sent, but none of the SendObject properties exposes the actual Email Header - So I can't manipulate it using the SendObject funciton.<br />
<br />
So .. your suggestion that I should use an alternative program to send the emails sounds good. Indeed I was coming to the same conclusion myself. The question is which one (no need to answer that :-). I'll go hunting on the net). But possibly better, perhaps I could build and send the email from within Access without using the SendObject function at all. Again, I'll investigate that separately.<br />
<br />
in any case I will report back my solution for the next poor chap who faces the same problems.<br />
<br />
Many thanks for all your help.<br />
Ben<!--content-->OK, we have a solution. Here's how it's done.<br />
<br />
1. In MS Access set a reference to your Outlook object library<br />
2. Build a function that creates a new Outlook object<br />
3. Set the various properties of the new Outlook Object to suit your purpose.<br />
<br />
This worked for me because the Outlook Object exposes a property called HTMLBody - just what I needed.<!--content-->can't you access the HTMLBody with your first outlook object instead of making a new one? just curious.<br />
<br />
sounds like you got it all fix, good job.<!--content-->Good point. Apparently Outlook is designed for a MulitUser environment which means - according to the blurb, that if an instance is already open, that instance will be used instead of a new one when a new object is called for.<br />
<br />
I still have a bit of work to do, but the fix / solution seems to work in tests so far.<br />
<br />
My Next problem is to include images (The Company Logo) in the HTML - so I guess I'll have to either include the Logo as an attachment, or include a link to it on out Web site.<br />
<br />
What do you think?<br />
Ben<!--content-->ahh makes since.<br />
<br />
if you include any images it has to be from a link on the web. if youdon't you could inlcude it with the attachment but then they have to Download <!--more--> the html plus the images.<br />
<br />
I would do it from the web, but that is just me. have to remember that not all people have html email setup and some turn it off.<!--content-->
 
Back
Top