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.
Below I’ll show all three types of emails, and how to send an email using a remote SMTP server
in the event you are not running your own.
Set oMessage = CreateObject("CDO.Message")
oMessage.Subject = "Example CDO Message"
oMessage.Sender = "me@my.com"
oMessage.To = "test@test.com"
oMessage.TextBody = "This is some sample message text."
oMessage.Send
Posted in CDO Component

daniva




Recent Comments