Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SendObject to send HTML email with Template

Status
Not open for further replies.

Muppsy007

Programmer
Apr 4, 2003
98
NZ
Hello, I'm not sure if this is possible but can't seem to find anything here or on google.

I have a dive club table with a simple form. On this form is a button that when clicked, should open an a new email, with no attachments, but would like it to automatically load a header in the content pane (HTML format).

I have tried this simply by populating a string variable with the html code to do this, then sending it as an argument in the SendObject method.

Here is the code:
[blue]Dim strBody As String

strBody = "<table><tr><td bgcolor=""#020098""><img src="" width=""200"" height=""50""></td></tr></table>"

DoCmd.SendObject acSendNoObject, , acFormatHTML, , , , , strBody, True[/blue]

Now this works to a certain extent, Except the HTML is displayed exactly as written on the content pane. A look at the Source of the email reveals that all < have been replaced with &gt; and all > with &lt;

Any Ideas? Note that If i remove the entire <img tag from the string, the table is displayed correctly, color and all. So I assume it has something to do with the double quotes.

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top