Login   /   Register

Sending an HTML email

Rate this article
     0 votes, average: 0 out of 50 votes, average: 0 out of 50 votes, average: 0 out of 50 votes, average: 0 out of 50 votes, average: 0 out of 5
Loading ... Loading ...
April 1st, 2008 by daniva

Windows 2000 and Windows XP use CDO messaging as a replacement for CDONTS. Sending email with CDO is a simple task.
First we create a reference to the CDO component

Set objMessage = CreateObject("CDO.Message") 


then fill-in Sender, Subject and Recipient (To) fields of the headers and the body text which can be either plain text or HTML. You can also add a file attachment. You then use the Send method to send the email.

Set oMessage = CreateObject("CDO.Message") 
oMessage.Subject = "Example CDO Message" 
oMessage.Sender = "me@my.com" 
oMessage.To = "test@test.com" 
' ** The line below shows how to send using HTML included directly in your script
oMessage.HTMLBody = "<h1>This is some sample message html.</h1>" 
oMessage.Bcc = "you@your.com"
oMessage.Cc = "you2@your.com"
oMessage.Send

Posted in CDO Component

2 Responses to “Sending an HTML email”

  1. Sending an HTML email from a pre-made file | AdvancedQTP Says:

    [-]

    […] This QTip is another variation of Sending an HTML email. […]

  2. jloyzaga Says:

    [-]

    do you need outlook to be installed?

Leave a Reply

You must be logged in to post a comment.

This article was viewed 620 times