Pregunta: | 20086 - ENVIAR UN PáGINA RESULTANTE DE UN ASP POR CORREO ELETRóNICO |
Autor: | Alberto Pérez |
Necesito enviar por correo electrónico el código html resultante de la ejecución de una página asp.
Es decir un botón (enviar) que al pulsarlo mande la página actual por correo electrónico a una dirección de correo. Si me pudieran contestar esta duda me darían una gran alegría.(gracias) |
Respuesta: | Fernando Sierra |
es muy facil:
aquí te mando un borrador, espero que lo entiendas if Request.Form("enviar")<>"" then 'Set objMail = Server.CreateObject("CDONTS.NewMail") 'objMail.Body = "Cuerpo del mensaje" 'objMail.BodyFormat = 0 ''objMail.AppendBodyFromFile "C:\Documents and Settings\administrador.MADRID\Escritorio\correo.txt" 'objMail.From = "[email protected]" 'objMail.Importance = 0 'objMail.MailFormat = 1 'objMail.Subject="Subject" 'objMail.To = "[email protected]" 'objMail.AttachFile "C:\Documents and Settings\administrador.MADRID\Escritorio\correo.txt" 'objMail.Send ' <- linea 12 'Set objMail = nothing 'Set Mail = Server.CreateObject("Persits.MailSender") 'Mail.Host = "smtp.mycompany.com" 'Mail.From = "[email protected]" 'Mail.FromName = "Sales Department" 'Mail.AddAddress "[email protected]" 'Mail.Subject = "Sales Receipt" 'Mail.Body = "Dear John:" & chr(13) & chr(10) & "Thank you for your business." 'Mail.AppendBodyFromFile "C:\Documents and Settings\administrador.MADRID\Escritorio\correo.txt" 'Mail.send Set objMail = Server.CreateObject("CDONTS.NewMail") objMail.From = "alberto" objMail.MailFormat = 1 objMail.To = "[email protected]" 'objMail.ContentTransferEncoding = "quoted-printable" 'objMail.Charset = "windows-1251" 'objMail.AppendBodyFromFile "C:\Documents and Settings\administrador.MADRID\Escritorio\correo.txt" 'objMail.Cc = "hgjg" 'objMail.Subject="Subject" objMail.Body =Request.Form("Cuerpo") 'objMail.Send 'Set objMail = nothing objMail.send end if %> <html> <head> <title>Untitled</title> </head> <body> <form name="formulario" action="borrador.asp" method="post"> <input type="Submit" name="enviar" value="enviar"> <textarea name="cuerpo"> </textarea> </form> </body> </html> |