Login   /   Register

Sending a text 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.

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

Leave a Reply

You must be logged in to post a comment.

This article was viewed 349 times