<
%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
'System variables
strContactEmail = "support@hannahprint.co.uk"
intSMTPPort = "25"
strSMTPHost = "mail.r2-hosting.com"
strSMTPComponent = "Persits_ASPEmail"
'Is form being posted
If Request.Form() <> "" And Request.Form("formclear") = "" And Request.Form("formclear.x") = "" Then
'Read in form fields and check all required have been supplied
strFirstName = Trim(Request.Form("FirstName"))
strLastName = Trim(Request.Form("LastName"))
strEmail = Trim(Request.Form("Email"))
strEmail2 = Trim(Request.Form("Email2"))
strJob = Trim(Request.Form("Job"))
strURL = Trim(Request.Form("URL"))
strTel = Trim(Request.Form("tel"))
strMessage = Trim(Request.Form("Message"))
strContactMethod = Request.Form("ContactMethod")
'Initialise error message string
strErrorMessage = ""
'Now check for required fields
If strFirstName = "" Then strErrorMessage = strErrorMessage & vbCrLf & "
You have not entered your first name."
If strLastName = "" Then strErrorMessage = strErrorMessage & vbCrLf & "
You have not entered your last name."
If strEmail = "" Then
strErrorMessage = strErrorMessage & vbCrLf & "
You have not entered your email address."
ElseIf strEmail2 <> strEmail Then
strErrorMessage = strErrorMessage & vbCrLf & "
The email address verification does not match your email address."
ElseIf CheckEmail(strEmail) Then
strErrorMessage = strErrorMessage & vbCrLf & "
The email address entered does not appear to be a valid internet address, it must be of the form account@domain, eg. support@hannahprint.co.uk or support@hannahprint.co.uk ."
End If
If strTel = "" Then strErrorMessage = strErrorMessage & vbCrLf & "
You have not entered your telephone number."
If strContactMethod = "" Then strErrorMessage = strErrorMessage & vbCrLf & "
You have not selected your preferred method of contact."
'If strBestTime = "" Then strErrorMessage = strErrorMessage & vbCrLf & "
Please let us know when is the best time to contact you."
'If strMessage = "" Then strErrorMessage = strErrorMessage & vbCrLf & "
You have not entered any message details."
'Any problems?
If strErrorMessage = "" Then
blnShowForm = False
'OK, add to database and send email
If strErrorMessage = "" Then
'Create email body
strMessageContent = _
"New Call Back Request Details:" & vbCrLf & _
"==============================" & vbCrLf & _
"Name: " & strFirstName & " " & strLastName & vbCrLf & _
"Email: " & strEmail & vbCrLf & _
"Tel: " & strTel & vbCrLf & _
"Preferred Method of Contact: " & strContactMethod & vbCrLf
If strMessage <> "" Then
strMessageContent = strMessageContent & vbCrLf & _
"Message Details:" & vbCrLf & _
strMessage & vbCrLf
End If
'Set email properties
%>
<%
'Send email
If SendEmail(strEmail,strFirstName & " " & strLastName,strContactEmail,"New call back reqest from website",strMessageContent,"",False,"","") Then
Else
'blnShowForm = True
'strErrorMessage = "Unable to send email"
End If
End If
Else
'Do nothing else, just show the form again with the entered fields so corrections can be made
blnShowForm = True
End If
Else
blnShowForm = True
'Set default value for URL field
strURL = "http://"
End If
%>
|
Lines are open 9am-5pm |
|
||
|
|||
Hannah Print , Acocks Green, Birmingham | Tel: | Fax: | Email: support@hannahprint.co.uk |
|||