CDO question -- generating email messages in HTML format

C

CB

CDO is perhaps the most obscure art in web programming, but I hope someone
would understand my issue. I have an ASP web application that needs to send
email messages in HTML format only -- there is no plain text version. The
messages are summaries of answers that people have input into an online
survey, and need to have a tabular form.

The following somewhat plausible code does not work:

dim OMsg
Set OMsg = Server.CreateObject("CDO.Message")
OMsg.Fields("urn:schemas:mailheader:return-path") = BounceEmail
OMsg.Fields("urn:schemas:mailheader:content-type") = "text/html"
OMsg.Fields.Update

The return path header is set as desired, but the content type header
stubbornly defaults to "text/plain". What is the secret to setting that
header?

I have seen lots of code examples on the MSDN site for setting the
content-type of body parts, but it seems needlessly complicated for my
situation and doesn't work on my system anyhow (unknown ProgID error). So I
was hoping to just set the message-level header to "text/html". (If I edit
one of the messages from my script in notepad, changing the header to
text/html by hand, it then is rendered correctly in email clients.)

Suggestions appreciated
 
A

AlanM

CB said:
CDO is perhaps the most obscure art in web programming, but I hope someone
would understand my issue. I have an ASP web application that needs to
send
email messages in HTML format only -- there is no plain text version. The
messages are summaries of answers that people have input into an online
survey, and need to have a tabular form.

The following somewhat plausible code does not work:


OMsg.HTMLBody = "your html"

I find that is all i have to do
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top