CDO question -- generating email messages in HTML format

Discussion in 'ASP General' started by CB, Nov 15, 2005.

  1. CB

    CB Guest

    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
     
    CB, Nov 15, 2005
    #1
    1. Advertising

  2. CB

    AlanM Guest

    "CB" <> wrote in message
    news:D...
    > 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
    >
    >
     
    AlanM, Nov 16, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    2
    Views:
    958
    dave wanta
    Jul 11, 2003
  2. Tony Meyer
    Replies:
    0
    Views:
    737
    Tony Meyer
    Jul 11, 2003
  3. Rob Meade

    CDO Email - multiple format option?

    Rob Meade, Apr 2, 2004, in forum: ASP General
    Replies:
    1
    Views:
    118
    Rob Meade
    Apr 2, 2004
  4. Replies:
    0
    Views:
    317
Loading...

Share This Page