Sending email with CDO

Discussion in 'ASP General' started by Boris, Jul 7, 2004.

  1. Boris

    Boris Guest

    I asked how to send an email using CDO instead of CDONTS and got several responses. They were all good, I tested the code and it works well. However, I forgot to mention that I need to set the email body to be in HTML rather than in plain text format. Would appreciate if someone could post a complete example on how to do this.
    Many thanks in advance
     
    Boris, Jul 7, 2004
    #1
    1. Advertising

  2. Boris

    dlbjr Guest

    myMail.From = ""
    myMail.To = ""
    myMail.Subject = "Subject"
    myMail.BodyFormat = 0
    myMail.MailFormat = 0
    myMail.Body = strHTML
    myMail.Send

    -dlbjr

    Discerning resolutions for the alms
     
    dlbjr, Jul 7, 2004
    #2
    1. Advertising

  3. Boris

    Boris Guest

    Sorry, the example below is no good. This is the message I got:"Error Type:
    Microsoft VBScript runtime (0x800A01B6)
    Object doesn't support this property or method: 'MailFormat'
    /test.asp, line 17"


    "dlbjr" wrote:

    > myMail.From = ""
    > myMail.To = ""
    > myMail.Subject = "Subject"
    > myMail.BodyFormat = 0
    > myMail.MailFormat = 0
    > myMail.Body = strHTML
    > myMail.Send
    >
    > -dlbjr
    >
    > Discerning resolutions for the alms
    >
    >
    >
     
    Boris, Jul 7, 2004
    #3
  4. Boris

    Patrice Guest

    With CDO.Message you just have to set the HtmlBody property instead of the
    TextBody property... This is the only change.

    Patrice

    --

    "Boris" <> a écrit dans le message de
    news:...
    > I asked how to send an email using CDO instead of CDONTS and got several

    responses. They were all good, I tested the code and it works well. However,
    I forgot to mention that I need to set the email body to be in HTML rather
    than in plain text format. Would appreciate if someone could post a complete
    example on how to do this.
    > Many thanks in advance
    >
     
    Patrice, Jul 7, 2004
    #4
  5. http://www.aspfaq.com/2026
    http://www.aspfaq.com/2474

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)





    "Boris" <> wrote in message
    news:...
    >I asked how to send an email using CDO instead of CDONTS and got several
    >responses. They were all good, I tested the code and it works well.
    >However, I forgot to mention that I need to set the email body to be in
    >HTML rather than in plain text format. Would appreciate if someone could
    >post a complete example on how to do this.
    > Many thanks in advance
    >
     
    Aaron [SQL Server MVP], Jul 7, 2004
    #5
  6. > myMail.MailFormat = 0

    ? Are you sure this is for CDO.Message?

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)
     
    Aaron [SQL Server MVP], Jul 7, 2004
    #6
  7. Boris

    mgm Guest

    oMessage.BodyPart.ContentMediaType = "text/html"
    oMessage.HtmlBody = strBody

    "Boris" wrote:

    > I asked how to send an email using CDO instead of CDONTS and got several responses. They were all good, I tested the code and it works well. However, I forgot to mention that I need to set the email body to be in HTML rather than in plain text format. Would appreciate if someone could post a complete example on how to do this.
    > Many thanks in advance
    >
     
    mgm, Sep 29, 2004
    #7
    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. Jay

    CDO not sending email

    Jay, Jan 15, 2004, in forum: ASP General
    Replies:
    5
    Views:
    132
  2. Irene
    Replies:
    0
    Views:
    231
    Irene
    May 1, 2004
  3. dave

    sending email using CDO Message

    dave, May 5, 2004, in forum: ASP General
    Replies:
    1
    Views:
    164
    Aaron Bertrand - MVP
    May 5, 2004
  4. dave

    sending image thru email + CDO

    dave, Jun 8, 2004, in forum: ASP General
    Replies:
    2
    Views:
    186
    Aaron [SQL Server MVP]
    Jun 8, 2004
  5. Drew
    Replies:
    1
    Views:
    149
    Ray Costanzo [MVP]
    Dec 9, 2004
Loading...

Share This Page