Sending a User's Feedback to the Webmaster in an Email
By Rob Taylor
Here is a simple example of sending the results of a form to the Webmaster (via an email).
'Get all the form data entered by the user
mail = request.form("email")
fname = request.form("first")
lname = request.form("last")
reply = "Reply TO <firstname.lastname@example.org>"
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = reply
objMail.Subject = "Sending Form Data in CDONTS from ASPadvice"
objMail.To = mail
'This is the mail body. vbCrLf puts in a new line. (like <BR>)
objMail.Body = fname & " " & lname & " " & mail & vbcrlf& vbcrlf&_
"This information was submitted " & vbcrlf&_
"from a form"
set objMail = nothing
response.write("Message was sent successfully")
For a more in-depth look at this process, be sure to read: Mailing Form Results.
Copyright 2017 QuinStreet Inc. All Rights Reserved.
Advertise | Newsletters | E-mail Offers