Sending email with CDO

First we create a reference to the CDO component

Set objMessage = CreateObject(“CDO.Message”)

This sample sends a simple text email that can be viewed in any email client.

Set objMessage = CreateObject(“CDO.Message”)
objMessage.Subject = “Example CDO Message”
objMessage.From = “me@myemail.com”
objMessage.To = “test@test.com”
objMessage.TextBody = “This is some sample message text.”
objMessage.Send

Leave a Reply

Your email address will not be published. Required fields are marked *