CDONTS with ASP Part 3

Below is the code used in the cdontsmailreply.asp file and is really what makes all of this work.

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>
<html>
<head>
<title>Email Sent with CDONTS NewMail</title>
<script language = “JavaScript”>
function SendAnother()
{
window.location = “http://www.yourdomain.com/cgi-bin/cdontsmailform.html”
}
</script>
</head>
<body>
<%
On Error Resume next
Dim MyMail
Set MyMail = CreateObject(“CDONTS.NewMail”)
MyMail.From = Request.Form(“FromField”)
MyMail.To = Request.Form(“ToField”)
MyMail.Cc = Request.Form(“CcField”)
MyMail.Bcc = Request.Form(“BccField”)
MyMail.Subject = Request.Form(“SubjectField”)
MyMail.BodyFormat = Request.Form(“BodyFormatField”)
MyMail.MailFormat = Request.Form(“MailFormatField”)
MyMail.Importance = Request.Form(“ImportanceField”)
MyMail.Body = Request.Form(“BodyField”)
MyMail.Send
Set MyMail = Nothing
%>
<center>
<h3> Message has been sent!
</h3>
<p></p>
<input type=”button” value=”Send Another” OnClick=”SendAnother()”>
</center>
</body>
</html>

Leave a Reply