Frequently Asked Questions

Help Center Search

Cdonts Example for ASP Hosting

Print this Article
Comment on this Article
Last Updated: May 21, 2008 9:56 AM

This is an example of a Cdonts script that works with our ASP hosting plan. This script has an auto-redirection at the end of it.

Modify the items in italics below to match your particular settings.

<%
from = request.form("from")
body = request.form("body")
subject = request.form("subject")
%>

<%
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = from
objMail.Subject = subject
objMail.To = "hard-code your email address"
objMail.Body = body
objMail.Send

Set objMail = Nothing
Response.redirect "thankyou.asp" '<- auto-redirection
'You must always do this with CDONTS.
'Change the page name to one that exists on your site.
%>