Código:
Const cdoSendUsingPort = 2 Set iMsg = Server.CreateObject("CDO.Message") set iConf = Server.CreateObject("CDO.Configuration") Set iFlds = iConf.Fields With iFlds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' cdoSendUsingPort .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.xxx.xxx" 'iServer .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'Si el servidor requiere autentificación .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "usuario" 'Cuenta SMTP .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "clave" 'Contraseña SMTP .Update End With iMsg.Configuration = iConf iMsg.From = "Prueba" 'Dirección del remitente iMsg.Subject = "asunto 2" 'Asunto del mensaje iMsg.TextBody = "hola 2" 'Cuerpo del mensaje iMsg.To = "[email protected]" 'Dirección de destino iMsg.Send set iMsg = nothing set iConf = nothing set iFlds = nothing IF ERR.number <> 0 THEN Texto_email = "1 - Error : "& ERR.Description 'Texto_email = "<br />Error, Sentimos las molestias. <br/><br/>"& ERR.Description ELSE Texto_email = "ok." END IF