|
Support
<%@ Language = "VBScript" %>
<%
Select Case Request.Querystring("Action")
Case "Send"
on error resume next
'Set variables
Dim BackURL
Dim strName
Dim strCompany
Dim strAddress
Dim strCountry
Dim strZipcode
Dim strTel
Dim strFax
Dim strEmail
Dim strSubject
Dim strMessage
Dim strUserIP
Dim strToEmail
Dim daCdoMail
'Replace this email with your real email id
strToEmail = "tttan@medit.com.my"
BackURL = Request.ServerVariables("HTTP_REFERER")
strName = Request.form("Name")
strCompany = Request.form("Company")
strAddress = Request.form("Address")
strCity = Request.form("City")
strState = Request.form("State")
strCountry = Request.form("Country")
strZipCode = Request.form("ZipCode")
strTelno = Request.form("TelNo")
strFaxno = Request.form("FaxNo")
strNature = Request.form("Nature")
strEmail = Request.form("Email")
strSubject = Request.form("Subject")
strMessage = Request.form("Message")
strUserIP = Request.ServerVariables("REMOTE_ADDR")
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
'Create Mail Object
With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "127.0.0.1"
.Item(sch & "smtpserverport") = 25
.update
End With
Set daCdoMail = CreateObject("Cdo.Message")
daCdoMail.Configuration = cdoConfig
daCdoMail.To = strToEmail
daCdoMail.From = strEmail
daCdoMail.Subject = strSubject
daCdoMail.HTMLBody = "This message was sent by :- Name: " & strName & " Company Name: " & strCompany & " Address: " & strAddress & " , " & strCity & " ," & strState & " ," & strCountry & " , " & strZipcode & " Tel No: " & strTelno & " Fax No: " & strFaxno & " Your Business Nature: " & strNature & " Date/Time Post: " & Now() & ".
Message: " & strMessage & _
" Enquiry Form Powered by Marketing Department " & _
"http://www.fastmark.com.my"
'You can change the mail body format setting below
'0 = HTML, 1 = TEXT
'daCdoMail.BodyFormat = 0
'You can change the mail format setting below
'0 = HTML, 1 = TEXT
'daCdoMail.MailFormat = 0
'Set Server Side Validation to make sure we got both sender and recipient email Id to send email
If strToEmail = "" OR strEmail = "" Then
Session("msg") = "Sender Email or Resipient Email is blank. This message can not be sent. Please try again"
Response.redirect (BackURL)
Else
'Now send email to the address you specified at line no. 16
daCdoMail.Send
End If
'Destroy mail object
Set daCdoMail = Nothing
Set cdoConfig = Nothing
'Create result text in a Sesion
Session("MsgSent") = "Your enquiry with subject [" & strSubject & "] has been sent. Thank you for your enquiry, we will reply back as soon as posibble."
'Redirect and show the result
Response.redirect (BackURL)
End Select
%>
Enquiry Form
<%If Session("msgSent") = "" Then%>
<%Else%>
Message Sent
|
|
<%=Session("MsgSent")%> |
|
<%
'DO NOT REMOVE THIS LINE
Response.write " Fastmark Enquiry Form Powered by Fastmark Marketing Dept. " & _
"http://www.fastmark.com.my"
%>
|
<%End If
'Destroy session variables
Session("MsgSent") = ""
Session("msg") = ""
%>
|