%
If Request("Send") = "Yes" Then
Dim strContactName
strContactName = Request("ContactName")
Dim strContactEmail
strContactEmail = Request("ContactEmail")
Dim strContactPhone
strContactPhone = Request("ContactPhone")
Dim strURL
strURL = Request("URL")
Dim strCompany
strCompany = Request("Company")
Dim strAddress
strAddress = Request("Address")
Dim strAddress2
strAddress2 = Request("Address2")
Dim strCity
strCity = Request("City")
Dim strState
strState = Request("State")
Dim strZipCode
strZipCode = Request("ZipCode")
Dim strCountry
strCountry = Request("Country")
Dim strComments
strComments = Request("Comments")
If strContactName = "" Then
Response.Redirect "error.asp?Error=You must enter a contact name." &_
"
Use the Back Button below."
ElseIf strContactEmail = "" Then
Response.Redirect "error.asp?Error=You must enter your email address." &_
"
Use the Back Button below."
End If
If inStr(strContactEmail, "@") Then
Else
Response.Redirect "error.asp?Error=The email address used does not appear to be valid.
" &_
"Please go back and check your email address.
" &_
"An example email is name@domain.com. There must be an @ sign and no www."
End If
If inStr(strContactEmail, "www") Then
Response.Redirect "error.asp?Error=The email address used does not appear to be valid.
" &_
"Please go back and check your email address.
" &_
"An example email is name@domain.com. There must be an @ sign and no www."
End If
If strComments = "" Then
Response.Redirect "error.asp?Error=You must enter your comments." &_
"
Use the Back Button below."
End If
Dim strSubject
strSubject = "Contact Form"
Dim strBody
strBody = vbCrLf & "=== Inquiry Information ===" & vbCrLf & vbCrLf & _
"Name: " & strContactName & vbCrLf & _
"Email: " & strContactEmail & vbCrLf & _
"Web Site: " & strURL & vbCrLf & _
"Phone: " & strContactPhone & vbCrLf & _
"Company Name: " & strCompany & vbCrLf & _
"Address: " & strAddress & vbCrLf & _
"Address 2: " & strAddress2 & vbCrLf & _
"City: " & strCity & vbCrLf & _
"State: " & strState & vbCrLf & _
"Zip Code: " & strZipCode & vbCrLf & _
"Country: " & strCountry & vbCrLf & _
"Comments:" & vbCrLf & strComments
On Error Resume Next
If strEmailComponent = "Persits" Then
Dim Mail
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = strMailServer
Mail.From = strContactEmail
Mail.AddAddress strCoEmail
Mail.AddCC strContactEmail
Mail.Subject = strSubject
Mail.Body = strBody
Mail.Send
Set Mail = Nothing
ElseIf strEmailComponent = "Dundas" Then
Dim objMailer
Set objMailer = Server.CreateObject("Dundas.Mailer")
objMailer.SMTPRelayServers.Add strMailServer
objMailer.FromAddress = strContactEmail
objMailer.TOs.Add strCoEmail
objMailer.CCs.Add strContactEmail
objMailer.Subject = strSubject
objMailer.Body = strBody
objMailer.SendMail
Set objMailer = Nothing
ElseIf strEmailComponent = "CDOSYS" Then
Dim cdoMail
Set cdoMail = Server.CreateObject("CDO.Message")
cdoMail.From = strContactEmail
cdoMail.To = strCoEmail
cdoMail.Cc = strContactEmail
cdoMail.Subject = strSubject
cdoMail.TextBody = strBody
On Error Resume Next
cdoMail.Send()
IF Err <> 0 THEN
Response.Write "There has been an error and your message could not be sent through the CDOSYS Email." & Err.Description
END IF
Set cdoMail = Nothing
ElseIf strEmailComponent = "JMailer" Then
Dim JMail
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.ServerAddress = strMailServer
JMail.Sender = strContactEmail
JMail.AddRecipient strCoEmail
JMail.AddRecipientCC strContactEmail
JMail.Subject = strSubject
JMail.Body = strBody
JMail.Priority = 1
JMail.Execute
Set JMail = Nothing
ElseIf strEmailComponent = "CDONTS" Then
Dim objCDOMail
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
objCDOMail.From = strContactEmail
objCDOMail.To = strCoEmail
objCDOMail.Cc = strContactEmail
objCDOMail.Subject = strSubject
'objCDOMail.BodyFormat = 0
'objCDOMail.MailFormat = 0
objCDOMail.Body = strBody
objCDOMail.Importance = 1
objCDOMail.Send
Set objCDOMail = Nothing
Else
End If
If Err <> 0 Then
Response.Write Err.Description
End If
Else
End If
%>
|
The information has been successfully submitted. Thank you for contacting <%= strMyCoName %>. |