% IF Request.Form("mail_send") = "y" THEN '******************************************************* 'Get values from hidden fields for sending the mail '******************************************************* form_from = Request.Form("mail_from") 'who is the mail from, e.g. feedback@yoursite.com form_to = Request.Form("mail_to") 'who is the mail to, e.g. info@yourcompany.com form_cc = Request.Form("mail_cc") 'leave blank if not needed! who is the carbon copy to be sent to, e.g. joe@yourcompany.com form_bcc = Request.Form("mail_bcc") 'leave blank if not needed! who is the blind carbon copy to be sent to, e.g. karen@yourcompany.com form_subject = Request.Form("mail_subject") 'text to appear in subject line of the e-mail form_importance = Request.Form("mail_importance") 'importance of the e-mail. Must be a number 0, 1 or 2. 2 = High, 1 = Normal, 0 = Low form_redirect = Request.Form("mail_redirect") 'page to redirect to after sending e-mail, e.g. http://yoursite.com/thankyou.htm '******************************************************* 'If values are empty, put in some defaults '******************************************************* form_from = "info@oldworldcraftsmen.biz" form_to = "info@oldworldcraftsmen.biz" form_subject = "OldWorldCraftsmen.biz Website Feedback" form_importance = 1 form_redirect = "thankyou.html" '******************************************************* 'Get all form elements and structure the e-mail '******************************************************* FOR x = 1 TO Request.Form.Count IF Request.Form.Key(x) = "mail_from" OR Request.Form.Key(x) = "mail_to" OR Request.Form.Key(x) = "mail_cc" OR Request.Form.Key(x) = "mail_bcc" OR Request.Form.Key(x) = "mail_subject" OR Request.Form.Key(x) = "mail_importance" OR Request.Form.Key(x) = "mail_redirect" OR Request.Form.Key(x) = "mail_send" OR Request.Form.Key(x) = "Submit" THEN form_variables = form_variables ELSE form_variables = form_variables & Request.Form.Key(x) & ": " & vbcrlf & Request.Form.Item(x) & vbcrlf & vbcrlf END IF NEXT DIM body_text body_text = vbcrlf & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbcrlf body_text = body_text & "Feedback from your Web Site" & vbcrlf body_text = body_text & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbcrlf & vbcrlf body_text = body_text & form_variables body_text = body_text & "Sent from: " & vbcrlf & Request.ServerVariables("HTTP_REFERER") & vbcrlf & vbcrlf body_text = body_text & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbcrlf '******************************************************* 'Get values from hidden fields for sending the mail '******************************************************* SET objMail = Server.CreateObject("CDONTS.NewMail") objMail.BodyFormat = 1 objMail.MailFormat = 1 objMail.From = form_from objMail.To = form_to 'objMail.CC = form_cc 'objMail.BCC = form_bcc objMail.Subject = form_subject objMail.Importance = form_importance objMail.Body = body_text objMail.Send 'This line actually sends the e-mail SET objMail = NOTHING IF form_redirect = "" THEN Response.Write("Thank You. Mail Sent.") ELSE Response.Redirect(form_redirect) END IF END IF %>
![]() |
||||||||||
![]() |
|
|||||||||
|
Copyright © 2003 Old World Craftsmen, Inc. All rights reserved.
Website developed by Brad Handy |
||||||||||