Funcion para envio de correo electronico.
lo he probado en IIS 5 y funciona siempre
Código asp:
Ver originalfunction enviaEmail(para,cc,desde,asunto,mensaje,servidor)
on error resume next
enviaEmail = false
dim objCDO,objCDOConfig,objFields
Set objCDO = CreateObject("CDO.Message")
Set objCDOConfig = CreateObject("CDO.Configuration")
Set objFields = objCDOConfig.Fields
With objFields
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = servidor
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item("http://schemas.microsoft.com/cdo/configuration/SendUsing") = 2
.Update
End With
With objCDO
.Configuration = objCDOConfig
.To = para
if cc <> false then
.cc = cc
end if
.From = desde
.Subject = asunto
.TextBody = mensaje
.Send
End With
Set objFields = Nothing
Set objCDO = Nothing
Set objCDOConfig = Nothing
if err.number = 0 then
enviaEmail = true
else
enviaEmail = err.description
end if
on error goto 0
end function