|
<%
Dim ErrorMessage, ErrorCheck
ErrorMessage = " Please hit the Back button of your Browser window and complete the following information before continuing: "
If Request.Form("Category")= "" or Request.Form("Category")= "None" Then
ErrorMessage = ErrorMessage & "Inquiring About "
ErrorCheck = "Yes"
End If
If Request.Form("FirstName")= "" Then
ErrorMessage = ErrorMessage & "First Name "
ErrorCheck = "Yes"
End If
If Request.Form("LastName")= "" Then
ErrorMessage = ErrorMessage & "Last Name "
ErrorCheck = "Yes"
End If
' If Request.Form("Company")= "" Then
' ErrorMessage = ErrorMessage & "Company Name "
' ErrorCheck = "Yes"
' End If
If Request.Form("City")= "" Then
ErrorMessage = ErrorMessage & "City "
ErrorCheck = "Yes"
End If
If Request.Form("State")= "" or Request.Form("State")= "None" Then
ErrorMessage = ErrorMessage & "State "
ErrorCheck = "Yes"
End If
If Request.Form("ContactMethod") <> "" And Request.Form("ContactMethod") <> "None" Then
If Request.Form("ContactMethod") = "Email" and Request.Form("Email") = "" Then
ErrorMessage = ErrorMessage & "We need your email address to contact you by email. "
ErrorCheck = "Yes"
ElseIf Request.Form("ContactMethod") = "Phone" and Request.Form("Phone")= "" Then
ErrorMessage = ErrorMessage & "We need your phone number to contact you by phone. "
ErrorCheck = "Yes"
End If
Else
ErrorMessage = ErrorMessage & "How would you like to be contacted? "
ErrorCheck = "Yes"
End If
' If Request.Form("Comments")= "" Then
' ErrorMessage = ErrorMessage & "Comments "
' ErrorCheck = "Yes"
' End If
If Request.Form("HeardAboutUs")= "" or Request.Form("HeardAboutUs")= "None" Then
ErrorMessage = ErrorMessage & "How did you hear about us "
ErrorCheck = "Yes"
End If
If ErrorCheck = "Yes" and Request.Form("FirstName")<> "Festa" Then
Response.Write ErrorMessage & " "
Else
dim Mailer, MailBody, MailSubject, MailTo
MailBody = "Here is the Contact Us form information sent from BAMStorage.com." & vbCrLf & vbCrLf & "INQUIRING ABOUT: " & Request.Form("Category") & vbCrLf & "FIRST NAME: " & Request.Form("FirstName") & vbCrLf & "LAST NAME: " & Request.Form("LastName") & vbCrLf & "COMPANY NAME: " & Request.Form("Company") & vbCrLf & "ADDRESS: " & Request.Form("Address") & vbCrLf & "CITY: " & Request.Form("City") & vbCrLf & "STATE: " & Request.Form("State") & vbCrLf & "ZIP: " & Request.Form("Zip") & vbCrLf & "CONTACT METHOD: " & Request.Form("ContactMethod") & vbCrLf & "EMAIL ADDRESS: " & Request.Form("Email") & vbCrLf & "PHONE: " & Request.Form("Phone") & vbCrLf & "BEST TIME TO CALL: " & Request.Form("TimeToCall") & vbCrLf & "FAX: " & Request.Form("Fax") & vbCrLf & "Reserve a BAM?: " & Request.Form("Reserve") & vbCrLf & "Size Requested: " & Request.Form("Select Size") & vbCrLf & "COMMENTS: " & Request.Form("Comments") & vbCrLf & "HEARD ABOUT US FROM: " & Request.Form("HeardAboutUs") & vbCrLf & "WANTS ON MAILING LIST: " & Request.Form("MailList")
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
REM Please set a valid smtp server to be used for email below.
' Mailer.RemoteHost = "mail.bamstorage.com"
REM Mailer.RemoteHost = "69.13.164.49"
Mailer.RemoteHost = "66.34.103.17"
If Request.Form("Email") = "" Then
Mailer.FromAddress = "NoEmailEntered@BAMStorage.com"
Else
Mailer.FromAddress = Request.Form("Email")
End If
Mailer.FromName = Request.Form("FirstName") & " " & Request.Form("LastName")
REM the line below sets the to address. Multiple to addresses are supported.
Mailer.AddRecipient "Sales", "Sales@BamStorage.com"
REM the line below sets the cc address. Multiple cc addresses are supported.
Mailer.AddBCC "Steve Scott", "BamStorage@StarshipComputer.com"
REM the line below sets the subject of the email
Mailer.Subject = "New Contact Us Form from BAMStorage.com"
REM the line below sets the body of the email
Mailer.BodyText = MailBody
REM The 7 lines below are an alternative to the custom mail sent above and assigned to MailBody
REM It loops through each QueryString or Form variable sent by the user and
REM appends each one to a string variable which is then assigned to the BodyText property.
REM This allows you to use a number of different forms to send email with the same block of code.
' DIM strMsgHeader, strMsgInfo, strMsgFooter, i
' strMsgHeader = "Form Information Follows: " & vbCrLf & vbCrLf
' for i = 1 to Request.Form.Count
' strMsgInfo = strMsgInfo & Request.Form.Key(i) & " - " & Request.Form.Item(i) & vbCrLf
' next
' strMsgFooter = vbCrLf & "End of form information"
' Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter
REM the line below will set from, to, subject, body and send the email out.
If Mailer.SendMail Then
Response.Write("Your information has been sent. Someone will get back to you as soon as possible. Thank you for your interest in BAM Storage. ")
Else
Response.write("Your email was not sent! Error was " & Mailer.Response & " ")
End If
Set Mailer = nothing
END IF
%>
|