Sending email with CDO

B

Boris

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
 
D

dlbjr

myMail.From = "(e-mail address removed)"
myMail.To = "(e-mail address removed)"
myMail.Subject = "Subject"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = strHTML
myMail.Send

-dlbjr

Discerning resolutions for the alms
 
B

Boris

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

Patrice

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

Patrice

--

Boris said:
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.
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top