Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > CDO question -- generating email messages in HTML format

Reply
Thread Tools

CDO question -- generating email messages in HTML format

 
 
CB
Guest
Posts: n/a
 
      11-15-2005
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


 
Reply With Quote
 
 
 
 
AlanM
Guest
Posts: n/a
 
      11-16-2005

"CB" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> 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



>
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is ("http://schemas.microsoft.com/cdo/configuration/sendusing") doing in CDO uofs76@yahoo.com ASP General 0 02-07-2007 01:09 PM
CDO generating duplicate e-mails jourdain.augustin@pearson.com ASP General 0 10-05-2005 03:51 PM
Need help sending CDO email with dynamic HTML attachment NetNoise ASP General 6 01-10-2005 03:49 AM
CDO Email - multiple format option? Rob Meade ASP General 1 04-02-2004 10:02 PM
CDO for Windows 2000 vs CDO for Exchange 2000 ASP .Net 2 07-11-2003 12:31 PM



Advertisments