| <%
'If the form has not been submitted execute the following code
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("txtName") sEmail=Request.Form("txtEmail") sFeedback=Request.Form("txtFeedback") ' create the HTML formatted email text Dim sEmailText sEmailText = sEmailText & "Feedback message from: " & sName & vbcrlf & vbcrlf sEmailText = sEmailText & "Message:" & sFeedback & vbcrlf & vbcrlf sEmailText = sEmailText & "Date & Time:" & Now() & vbcrlf & vbcrlf sEmailText = sEmailText & "IP :" & Request.ServerVariables("REMOTE_ADDR") 'create the mail object Const cdoSendUsingMethod = _ "http://schemas.microsoft.com/cdo/configuration/sendusing" Const cdoSendUsingPort = 2 Const cdoSMTPServer = _ "http://schemas.microsoft.com/cdo/configuration/smtpserver" Const cdoSMTPServerPort = _ "http://schemas.microsoft.com/cdo/configuration/smtpserverport" Const cdoSMTPConnectionTimeout = _ "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout" Const cdoSMTPAuthenticate = _ "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" Const cdoBasic = 1 Const cdoSendUserName = _ "http://schemas.microsoft.com/cdo/configuration/sendusername" Const cdoSendPassword = _ "http://schemas.microsoft.com/cdo/configuration/sendpassword" Dim objConfig ' As CDO.Configuration Dim objMessage ' As CDO.Message Dim Fields ' As ADODB.Fields ' Get a handle on the config object and it's fields Set objConfig = Server.CreateObject("CDO.Configuration") Set Fields = objConfig.Fields ' Set config fields we care about With Fields .Item(cdoSendUsingMethod) = cdoSendUsingPort .Item(cdoSMTPServer) = "smtp.1and1.com" .Item(cdoSMTPServerPort) = 25 .Item(cdoSMTPConnectionTimeout) = 10 .Item(cdoSMTPAuthenticate) = cdoBasic .Item(cdoSendUserName) = "feedback@facebookagent.com" .Item(cdoSendPassword) = "0okmmko0" .Update End With Set objMessage = Server.CreateObject("CDO.Message") Set objMessage.Configuration = objConfig With objMessage .To = "feedback@facebookagent.com" .From = sEmail .Subject = "Feedback" .TextBody = sEmailText .Send End With Set Fields = Nothing Set objMessage = Nothing Set objConfig = Nothing Response.write " Thank you for sending your feedback. "
End If
%>" Response.write "We will get back to you if necessary. |