CDONTS is available on the Windows NT /2000 platforms and provides the necessary objects , methods and properties to send email . You can also send attachments , send HTML mail and various other tasks .
Lets Begin :
First of all we have to create an instance of the CDONTS object , we achieve this like this
Set objCdonts = Server.CreateObject(“CDONTS.NewMail”)
Now we add the various important email addresses to the script , these include the address you are sending to , the address where the mail is from .
objCdonts.To = “firstname.lastname@example.org”
objCdonts.From = “email@example.com”
Now lets add the subject line of the email message. We do this with the following.
objCdonts.Subject = “Hello this is my sample email”
OK hopefully you are still with me , an email is no use without some message in the actual body of it , here is how we go about this .
objCdonts.Body = “Hello , I am just testing this email script out “
OK that’s our email all set up and ready to go but wait we need to send it and once it is sent it always good practice to delete the instance of the CDONTS object and free up resources on your server.
Set objCdonts = Nothing
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.