Here is a sample for sending mail using CDONTS…
Please note that CDONTS is not supported on Windows 2003 and later:
‘ HOWTO: CDONTS/VBS Send and Eamil with an attatchment
‘ For more information on sending an email using CDONTS see:
‘ NewMail Object (CDONTS Library)
Dim objMail ‘As CDONTS.NewMail
Set objMail = CreateObject(“CDONTS.Newmail”)
objMail.BodyFormat = 1 ‘ 0-The message is in MIME format, 1-The message is in uninterrupted plain text.
objMail.Importance = 1 ‘ 0-Low importance, 1-Normal Importance(Default),2-High Importance
‘objMail.From = “firstname.lastname@example.org” ‘ TODO: Change this to the address you are sending from
‘objMail.To = “email@example.com” ‘ TODO: Change this to the address you are sending to
objMail.Subject = “Are you aready for the meeting?” ‘ TODO: Change this to the Subject you want to use
objMail.Body = “Don’t forget the cookies!” ‘ TODO: Change this to the body of the message.
‘ TODO: Comment out the next line if you are not sending an attatchement.
objMail.AttachFile “C:\download\myfile” ‘ TODO: Change this to the path and name of the file you are attatching.
Set objMail = Nothing