CDO message help

J

Jishnu

Hi All,
Need CDO help
<%@ Language=VBScript %>
<%
Dim iMsg
Dim iConf
Dim Flds
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
Flds("http://xyz.com") = True
Flds.Update

With iMsg
Set .Configuration = iConf
.CreateMHTMLBody "http://xyz.com"
.HTMLBody="<h1>Jishnu</h1>
.To = "(e-mail address removed)"
.From = "CLOUT Reporting Unit <[email protected]>"
.Subject = "Daily Snapshot Report"
.Send
End With
%>

The problem with this it does not CreateMHTMLBODY but if I take the
..HTMLBODY off then .CReateMHTMLBODY works.
I need to add some HTML body along with the url.
Does anyone know how to correct the code.
Thanks
 
R

Ray Costanzo [MVP]

You're overwriting the body with the code you have. The .CreateHTMLBody
method grabs the HTML string and gives that value to the .HTMLBody property.
It'd be as though you're doing this:

..HTMLBody = "hi"
..HTMLBody = "bye"

Would you expect "hibye" to be the .HTMLBody then? No, it'd just be "bye."


If you want to concatenate more html to the body, do:

..CreateHTMLBody "http..."
..HTMLBody = .HTMLBody & "<h1>.." '<--don't forget closing " as you did
below

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top