Categories

Send email with ASP

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

<%
Dim objCdonts
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 = “youraddress@youremail.com”
objCdonts.From = “myaddress@myemail.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.

objCdonts.Send
Set objCdonts = Nothing

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

Leave a Reply

  

  

  


*

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>