Sending E-mail with CDONTS
Go BackThis example shows how to send an email with ASP. This is
possible using CDO (Collaboration Data Objects), a COM library
created to send email via SMTP protocol.
In order to run this example you must set the correct value for
"from" and "to" properties of objCDO.
---------- SendMail.asp -------------------
<HTML>
<HEAD>
<title> Here is the code for sending an email using ASP </title>
</HEAD>
<BODY>
<%
' declare a CDO object
dim objCDO
' create a CDO object
set objCDO = Server.CreateObject("CDONTS.NewMail")
' set the properties
objCDO.From = "youraccount@yourdomainname"
objCDO.To = "anotheraccount@domainname"
objCDO.Subject = "mail test"
objCDO.Body = "Hello this is a Test"
' send the email
objCDO.Send
set objCDO = Nothing
response.write ("Message successfully sent.")
%>
</BODY>
</HTML>
Go Back
If
you have any questions:
support@ITsGroup.org or Phone 1-780-669-1548. |