%Option Explicit%>
<%
response.expires = 0
response.expiresabsolute = Now() - 1
response.addHeader "pragma","no-cache"
Response.Buffer = true
response.addHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<%
dim SessionCAPTCHA
Function CheckCAPTCHA(valCAPTCHA)
SessionCAPTCHA = Trim(Session("CAPTCHA"))
Session("CAPTCHA") = vbNullString
if Len(SessionCAPTCHA) < 1 then
CheckCAPTCHA = False
exit function
end if
if CStr(SessionCAPTCHA) = CStr(valCAPTCHA) then
CheckCAPTCHA = True
else
CheckCAPTCHA = False
end if
End Function
%>
<%
dim dtarea, dderror, strCAPTCHA
dim dnombre, demail, dtexto, dtelefono, mensaje
dnombre= request("nombre")
demail= request("email")
dtexto= request("texto")
dtelefono= request("telefono")
dtarea= request("tarea")
dderror= 112233
if dtarea= "enviar_correo" then
strCAPTCHA = Trim(Request.Form("strCAPTCHA"))
if CheckCAPTCHA(strCAPTCHA) = true then
dim ObjMail, ObjConfig
SET ObjMail = Server.createObject("CDO.Message")
SET ObjConfig = Server.createObject("CDO.Configuration")
With ObjConfig
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.vorean.com"
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 120
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "admin@vorean.com"
.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "madrid0987"
.Fields.update
End With
Set ObjMail.Configuration = ObjConfig
ObjMail.From= "info@vorean.com"
ObjMail.To= "info@vorean.com"
ObjMail.Subject= "Mensaje de contacto desde la web"
mensaje= ""
mensaje= mensaje & ""
mensaje= mensaje & "Fecha: " & now() & "
"
mensaje= mensaje & "Nombre: " & dnombre & "
"
mensaje= mensaje & "Telefono: " & dtelefono & "
"
mensaje= mensaje & "Email: " & demail & "
"
mensaje= mensaje & "Texto: " & dtexto & "
"
mensaje= mensaje & ""
ObjMail.HtmlBody= mensaje
On Error GoTo 0
On Error Resume Next
ObjMail.Send
If Err.Number <> 0 Then
dderror= 2
else
dderror= 1
dnombre= ""
demail= ""
dtexto= ""
dtelefono= ""
end if
Set ObjMail = Nothing
Set ObjConfig = Nothing
else
dderror= 3
end if
end if
%>