![]() |
Enviar email con asp en Wxp Hola, he tratado de enviar un email desde un codigo asp, mi SO es Wxp: ------------------------------------------------------ <% Set Mail = Server.CreateObject("CDO.Message") para = "[email protected]" de = "[email protected]" asunto = "Prueba de email con asp" mensaje = "Esto es una prueba para enviar e-mail desde ASP en Wxp Prof..." Mail.From = de Mail.To = para Mail.Subject = asunto Mail.TextBody = mensaje 'Mail.HTMLBody = mensaje Mail.Send Set Mail = Nothing %> ------------------------------------------------------ Pero me manda un error: ------------------------------------------------------ Tipo de error: CDO.Message.1 (0x80040220) No es válido el valor de configuración "SendUsing". /hd/envia6.asp, línea 12 ------------------------------------------------------ Alguien podria decirme el porque? Me falta configurar algo? Gracias... |
Te faltan las directivas de configuración antes de mail.send Código: objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 |
ok gracias.... Tendran algun link donde pueda informarme sobre estas directivas, o mas bien sobre como enviar e-mails utilizando CDOSYS...??? |
Hola, ya lo probe anexandole las directivas pero... me sigue generando el mismo error: CDO.Message.1 (0x80040220) No es válido el valor de configuración "SendUsing". Alguien podria porporcionarme un ejemplo basico de como enviar un email desde un ASP utilizando CDOSYS. ok gracias |
ok ok Gracias, ya consegui enviar el e-mail, gracias. |
Y no hubiera sido mejor que directamente lo publicaras aquí? Eso hubiera sido un buen uso del espíritu pedagógico de este foro. ;-) te conmino amablemente a que lo hagas. Un saludo. |
pana eso funciona con windows server 2003?? y con IIS 6? |
Pues yo lo corri en Wxp y despues en W2003 y no tuve ningun problema, ahorita el problema que tengo es que solo lo he probado con e-mail que estan dentro del domino que especifico. Hay alguna forma de enviar e-mail sin importar a que domino pertenezcan ALGO ASI COMO LO QUE HACE ESTE FORO CUANDO TE REGISTRAS. Te envia tu e-mail de subscripcion a cualquier cuenta (persona) de correo. ----------------------------------------------------------------- <% if (Request.Form()<>"") then Dim Mail, Config Set Mail = Server.createObject("CDO.Message") Set Config = Server.createObject ("CDO.Configuration") With Config .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.midominio.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") = 60 .Fields.update End With Set Mail.Configuration = Config Mail.From = "[email protected]" Mail.To = Request.Form("email") Mail.Subject = Request.Form("asunto") Mail.HTMLBody = Request.Form("mensaje") Mail.Send() Set Mail = Nothing Response.Write("E-mail enviado correctamente") else %> <form name="formail" method="post" action="enviax.asp"> <table align="center" cellpadding="3" cellspacing="1"> <tr><td>Email: </td> <td><input type="text" name="email" /></td> </tr> <tr><td>Asunto: </td> <td><input type="text" name="asunto" /></td> </tr> <tr><td>Mensaje: </td> <td><textarea name="mensaje"></textarea></td> </tr> <tr><td colspan="2" align="center"> <input type="submit" value=" Enviar " name="ok"> </td> </tr> </table> </form> <% end if %> -------------------------------------------------------------------- El archivo debe llamarse enviax.asp |
Re: Enviar email con asp en Wxp Tarde pero útil, Como no puedo postear links... classicasp.aspfaq.com/email/why-does-cdo-message-give-me-8004020f-errors.html |
Respuesta: Enviar email con asp a cualquier direccion <% 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") ="[email protected]" 'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="yourpassword" ObjSendMail.Configuration.Fields.Update 'End remote SMTP server configuration section== ObjSendMail.To = "[email protected]" ObjSendMail.Subject = "this is the subject" ObjSendMail.From = "[email protected]" ' 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 %> |
La zona horaria es GMT -6. Ahora son las 07:45. |
Desarrollado por vBulletin® Versión 3.8.7
Derechos de Autor ©2000 - 2025, Jelsoft Enterprises Ltd.