<% Function SendMail(fromWho, toWho, toCc, toBcc) Dim CDONTSMail '**********************************************************************************' '* CREATE AN INSTANCE TO THE CDONTS OBJECT *' '**********************************************************************************' Set CDONTSMail = CreateObject("CDONTS.NewMail") '----------------------------------------------------------------------------------' '**********************************************************************************' '* SPECIFY WHO THE EMAIL IS TO/FROM/ETC... *' '**********************************************************************************' CDONTSMail.From = fromWho CDONTSMail.To = toWho CDONTSMail.Bcc = toBcc CDONTSMail.Cc = ToCc '----------------------------------------------------------------------------------' '**********************************************************************************' '* INCLUDE A FILE ATTACHMENT *' '**********************************************************************************' '****** TO ATTACH A FILE YOU WILL NEED TO REPLACE "%ServerPathHere\file.txt%" WITH THE PATH TO THE FILE ON THE SERVER ******' 'CDONTSMail.AttachFile (%ServerPathHere\file.txt%) '****** Example: CDONTSMail.AttachFile ("D:\Hosting\MyWebSite\Files\TestFile.txt") ******' '----------------------------------------------------------------------------------' '**********************************************************************************' '* SPECIFY THE SUBJECT OF YOUR EMAIL *' '**********************************************************************************' CDONTSMail.Subject = "Thank you for your technical query" '----------------------------------------------------------------------------------' '**********************************************************************************' '* USE THE FOLLOWING CODE TO SEND PLAIN TEXT EMAILS *' '**********************************************************************************' Body = "Thank you for submiting your Technical Query to website. We will reply shortly:" & VbCrLf & VbCrLf &_ "Email: " & request.form("email") & VbCrLf &_ "Title: " & request.form("Title") & VbCrLf &_ "First Name: " & request.form("FirstName") & VbCrLf &_ "Last Name: " & request.form("LastName") & VbCrLf &_ "Address1: " & request.form("Address1") & VbCrLf &_ "Address2: " & request.form("Address2") & VbCrLf &_ "Town/City: " & request.form("TownCity") & VbCrLf &_ "County/State: " & request.form("CountyState") & VbCrLf &_ "Country: " & request.form("Country") & VbCrLf &_ "Post Code: " & request.form("PostCode") & VbCrLf & VbCrLf &_ "Technical Query: " & VbCrLf &_ request.form("Query") CDONTSMail.Body = Body '----------------------------------------------------------------------------------' '**********************************************************************************' '* COMMENT OUT THE ABOVE CODE, AND USE THE CODE BELOW TO SEND HTML EMAIL *' '**********************************************************************************' 'Body = "" 'Body = Body & "" 'Body = Body & "" 'Body = Body & "Title of your html email here" 'Body = Body & "" 'Body = Body & "" 'Body = Body & "

" 'Body = Body & "My Store
" 'Body = Body & "Order Received!

" 'Body = Body & "

Order details, etc..., etc...

" 'Body = Body & "" 'Body = Body & "" 'CDONTSMail.BodyFormat = 0 'CDONTSMail.MailFormat = 0 'CDONTSMail.Body = HTML '----------------------------------------------------------------------------------' '**********************************************************************************' '* SEND THE EMAIL AND CLEANUP THE INSTANCE TO THE CDONTS OBJECT *' '**********************************************************************************' CDONTSMail.Send Set CDONTSMail = Nothing '----------------------------------------------------------------------------------' End Function '**********************************************************************************' '* GRAB THE FORM DATA AND CALL THE FUNCTION TO SEND THE EMAIL *' '**********************************************************************************' EmailFrom = Request.Form("support") EmailTo = Request.Form("email") EmailBcc = Request.Form("support") EmailCc = "" If EmailFrom <> "" And EmailTo <> "" Then SendMail EmailFrom, EmailTo, EmailCc, EmailBcc MailSent = True End If '----------------------------------------------------------------------------------' '**********************************************************************************' '* REDIRECT BACK TO THE SAME FORM *' '**********************************************************************************' If MailSent = True Then 'Response.Redirect("techform.asp") Response.redirect "../done.htm" End If '----------------------------------------------------------------------------------' %> Email Form
" METHOD="POST" name="form1" id="form1">
Technical Query Form
Email
Title
First Name
Last Name
Address1
Address2
Town/City
County/State
Country
Post/Zip Code
Please enter (below) your technical query