How do I email a form when the submit button is clicked? We have not linked up to a database yet and I am trying to at least have an order form emailed to us when the customer clicks the submit button after filling in the form. Any clues?
Have your email form submit to this page (call it whatever you want.asp)
'**********************************************
<%
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail"
HTML = HTML & "<HTML>"
HTML = HTML & "<HEAD>"
HTML = HTML & "<TITLE>Send Mail with ASP</TITLE>"
HTML = HTML & "</HEAD>"
HTML = HTML & "<BODY bgcolor=""white"">"
HTML = HTML & "<TABLE cellpadding=""4"">"
HTML = HTML & "<TR><TH><FONT color=""darkblue"" SIZE=""4"">"
HTML = HTML & "Some TEXT goes here</FONT></TH></TR>"
HTML = HTML & "<TR><TD>"
HTML = HTML & "</FONT></TD></TR></TABLE>"
HTML = HTML & "</BODY>"
HTML = HTML & "</HTML>"
objMail.From = request.form("emailfield"'The From field could be anything you want, it does not have to be an actual email address if you don't want to. Be sure to let the user know this is an automated email tho.
objMail.Subject = "Email after filling out the form"
objMail.BodyFormat = 0
objMail.MailFormat = 0
objMail.To = request.form("user.email.from.form"
objMail.Body = HTML
objMail.Send
set objMail = nothing
response.redirect "AnyPage.asp"
%>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.