Enquiry |
<%
If Request("Send") <> "" Then
' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim FullName
Dim c_name
Dim EmailAddress
Dim Phone
Dim address
Dim city
Dim country
Dim MailMessage
Subject = (Request.Form("Subject"))
FullName = (Request.Form("FullName"))
EmailAddress = Trim(Request.Form("EmailAddress"))
Phone = (Request.Form("Phone"))
Address = (Request.Form("address"))
City = (Request.Form("city"))
Country = (Request.Form("country"))
MailMessage = (Request.Form("MailMessage"))
' validation
Dim validationOK
validationOK=true
If (Trim(FullName)="") Then validationOK=false
If (Trim(EmailAddress)="") Then validationOK=false
' prepare email body text
Dim strEMail
strEMail = strEMail & "Full Name " & FullName & VbCrLf
strEMail = strEMail & "Company Na,e: " & _name & VbCrLf
strEMail = strEMail & "Email Address: " & EmailAddress & VbCrLf
strEMail = strEMail & "Phone: " & Phone & VbCrLf
strEMail = strEMail & "Address: " & adress & VbCrLf
strEMail = strEMail & "city: " & city & VbCrLf
strEMail = strEMail & "Country: " & country & VbCrLf
strEMail = strEMail & "Message: " & MailMessage & VbCrLf
' get posted data into variables
strHost = "mail.highgradequicklime.com"
Set Mail = Server.CreateObject("Persits.MailSender")
' enter valid SMTP host
Mail.Host = strHost
Mail.Username = "enquiry@highgradequicklime.com"
Mail.Password = "shreenathhighgrade"
Mail.From = "enquiry@highgradequicklime.com"
Mail.FromName = "highgradequicklime.com - web enquiry"
Mail.AddAddress "sampl@sancharnet.com", "Tapan"
' message subject
Mail.Subject = Subject
' message body
Mail.Body = strEMail
strErr = ""
bSuccess = False
On Error Resume Next ' catch errors
If validationOK=false then
strErr = "Please fill the mandatory inputs"
Response.Write strErr
else
Mail.Send ' send message
If Err <> 0 Then ' error occurred
strErr = ""
strErr = Err.Description
Response.Write strErr & "there seems to be some problem in web contact form. Please email at info@highgradequicklime.com"
else
bSuccess = True
Response.Write "Many thanks for your enquiry. We will revert back asap"
End If
End If
End if
%>
|
|
|