<% If Request.Form="" Then %>
<%
'If the form has been submitted execute the following code
Else
'receive the form values
Dim sName, sEmail, sFeedback
sName=Request.Form("name")
sCompName=Request.Form("company")
sTitle=Request.Form("title")
sCity=Request.Form("city")
sCountry=Request.Form("country")
sPhone=Request.Form("phone")
sFax=Request.Form("fax")
sEmail=Request.Form("email")
sFeedback=Request.Form("message")
' create the HTML formatted email text
Dim sEmailText
sEmailText = sEmailText & ""
sEmailText = sEmailText & ""
sEmailText = sEmailText & "
Help Desk Support Ticket"
sEmailText = sEmailText & ""
sEmailText = sEmailText & ""
sEmailText = sEmailText & "Message from: " & sName & "
"
sEmailText = sEmailText & "Company:" & sCompName & "
"
sEmailText = sEmailText & "Title:" & sTitle & "
"
sEmailText = sEmailText & "City & Country:" & sCity & sCountry & "
"
sEmailText = sEmailText & "Phone & Fax:" & sPhone & sFax & "
"
sEmailText = sEmailText & "Email :" & sEmail & "
"
sEmailText = sEmailText & "Message:" & sFeedback & "
"
'sEmailText = sEmailText & "Date & Time:" & Now() & "
"
sEmailText = sEmailText & ""
sEmailText = sEmailText & ""
SUB sendmail( sEmail, toWho, Subject, Body )
Dim NewMailObj
Dim iConf
Dim Flds
Const cdoSendUsingPort = 2
'create the mail object
Set NewMailObj = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "mail-fwd"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPconnectiontimeout) = 10
.Update
End With
Set NewMailObj.Configuration = iConf
' enter valid SMTP host
'NewMailObj.RemoteHost = "smtp.futuresystems.com.sa;199.237.237.243"
NewMailObj.From = sEmail
NewMailObj.To = toWho
NewMailObj.Subject = Subject
NewMailObj.HTMLBody = sEmailText
NewMailObj.Send
END SUB
Dim toWho
Dim Subject
Dim Body
toWho = "helpdesk@futuresystems.com.sa"
Subject = "Online Feedback Form"
Body = sEmailText
If toWho <> "" THEN
sendMail sEmail, toWho, Subject, Body
'Cleanup
Set ObjCDO = Nothing
Set iConf = Nothing
Set Flds = Nothing
' Any existing page can be used for the response redirect method
%>
<% Response.write "Thank you for sending your feedback. "
Response.write "We will get back to you as soon as Possible. "%> |
<%
else
Response.Write "Mail Sending failure....Error Was" & NewMailObj.Response
end if
set NewMailObj=Nothing
Set iConf = Nothing
Set Flds = Nothing
%>
|
<%
End If
%>