%@ Language=VBScript%> <% messsage="" For Each x In Request.Form message = message & x & " : " & Request.Form(x) & CHR(10) Next mes = "" IsSuccess = false sTo = "form@munnarleisure.com" sFrom = Trim(Request.Form("email")) sSubject = "Contact Form!" sMailServer = "203.199.200.26" sBody = message if Request("__action")="EMail" then response.write message EMail() end if Sub EMail() Set objMail = Server.CreateObject("CDO.Message") Set objConf = Server.CreateObject("CDO.Configuration") Set objFields = objConf.Fields With objFields .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = sMailServer .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Update End With With objMail Set .Configuration = objConf .From = sFrom .To = sTo .Subject = sSubject .TextBody = sBody End With Err.Clear on error resume next objMail.Send if len(Err.Description) = 0 then mes = " " mes = mes + " " IsSuccess = true else mes = " " + Err.Description + " FAILED!" end if Set objFields = Nothing Set objConf = Nothing Set objMail = Nothing End sub Sub Alert(html) if IsSuccess then Response.Write "
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||