Send an email (CDONTs)

This shows how to send an e-mail using CDONTs . Note this has no validation attached to check for a valid e-mail address . Also a better example is to have a form with text boxes , text area , submit button . These will be in future examples .

Here is the code for this example.

<%
'declare our variables
Dim strMessage , objCDO
Set objCDO = Server.CreateObject("cdonts.NewMail")
'stick the e-mail address you are sending from in here
objCDO.From = "myaddress@myaddress.com"
'this is the email address you are sending to
objCDO.To = "anotheremail@myaddress.com"
'this is the title of your e-mail message
objCDO.subject = "this is a test message"
'this is your actual message
objCDO.body = " This is your actual message in here"
objCDO.send
%>

Sponsors