07 Sep 2010 
Sistema de Soporte » Preguntas Frecuentes ( FAQ ) » Como enviar correo desde ASP
 Login [Recuperar contrasena] 
Email:
Contrasena:
Recordarme:
 
 Buscar
 Opciones de Articulo
 Como enviar correo desde ASP
Respuesta

La mejor forma de enviar correo desde los servidores windows es usando CDOSYS y el servidor de correo de su cuenta, de esta forma utilizará su propia cuenta de correo como fuente.

El código es el siguiente:

 <%
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
    
'This section provides the configuration information for the remote SMTP server.
    
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.yoursite.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
    
' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="somemail@yourserver.com"
'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="yourpassword"
    
ObjSendMail.Configuration.Fields.Update
    
'End remote SMTP server configuration section==
    
ObjSendMail.To = "someone@someone.net"
ObjSendMail.Subject = "this is the subject"
ObjSendMail.From = "
someone@someone.net"
    
' we are sending a text email.. simply switch the comments around to send an html email instead
'ObjSendMail.HTMLBody = "this is the body"
ObjSendMail.TextBody = "this is the body"
    
ObjSendMail.Send
    
Set ObjSendMail = Nothing
%>

Puede consultar más ejemplos en el siguiente enlace: http://www.w3schools.com/asp/asp_send_email.asp



Detalles del Articulo
Codigo del Articulo: 5
Fecha de Creacion: 23 Sep 2007 07:16 AM

 Esta respuesta me fue util  Esta respuesta no me fue util

Home | Registrarse | Enviar Ticket | Preguntas Frecuentes ( FAQ ) | Solucionador de Problemas | Novedades
Lenguaje:

Soporte - Hosting Peru Web SupportSuite v3.11.00