Enviar formularios por email con asp

Hola
Estoy haciendo un formulario que ejecuta un .asp al enviarlo, el problema es que no se como se hace para que el .asp, envie el formulario a mi direccion de e-mail, ¿como se hace esto? ¿se pueden meter campos de adjuntar archivos en ese mismo formulario? Rogaria cuanto mas detalle mejor por que soy novato
muchas gracias

1 Respuesta

Respuesta
1
Carlos, aqui debes usar algun componente o activeX que te permite enviar correo con ASP. Uno que viene con NT es CDONTS. El codigo seri algo como :
<%
Option Explicit
Dim objMail
Dim strSubject
Dim strBody
strSubject = "This is a test email in HTML format"
strBody = "<HTML>" & _
"<HEAD></HEAD>" & _
"<BODY>" & _
" <Font Face=Arial Size=5><B>" & _
" This is a test Email" & _
" </B></Font><BR>" & _
" <H3><A Href=http://www.devasp.com/>Click here</a>" & _
" to go to DevASP.com</h3>" & _
"</BODY>" & _
"</HTML>"
' First create an instance of the NewMail Object
Set objMail = Server.CreateObject("CDONTS.NewMail")
' Please replace the "From" and "To" email addresses with your
' own valid email address. I recieve too many emails
' from people who test this sample and keep sending
' emails to [email protected], or they keep the "From" property
' as [email protected] and I get response of
' undeliverable emails.
' NOTE: If the "To" or "From" properties of CDONTS contain
' invalid email address you will not recieve the email.
objMail.From = "[email protected]"
objMail.To = "[email protected]"
objMail.Subject = strSubject
objMail.Body = strBody
' In order to send the email in HTML format we have to set
' both MailFormat and BodyFormat equal to zero
objMail.MailFormat = 0
objMail.BodyFormat = 0
objMail.Send
Set objMail = Nothing
%>

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas