When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips

Sections:
Sample Chapters
Commonly Asked Message Board Questions
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
XML Info
Information:
Feedback
Author an Article
ASP ASP.NET ASP FAQs Message Board Feedback
Print this page.
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 <rob@tconsult.com>"
  
  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"
  objMail.Send 
  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.

FAQ Table of Contents   Sending an Email with an Attachment Displaying Line Breaks in an Email 


ASP.NET [1.x] [2.0] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article