jmail asp ejemplo de envio

Esto es un ejemplo simple de envio con jmail:

2 ficheros el formulario y el asp que envia:

formulario.asp:


Email:
First Name:
Last Name:
Subject:
Comments:




confirmation.asp
<%
DIM strEmail, strFirstName, strLastName, strSubject, strComments, Mailer
strEmail = Request.Form("Email")
strFirstName = Request.Form("FirstName")
strLastName = Request.Form("LastName")
strSubject = Request.Form("Subject")
strComments = Request.Form("Comments")

Set JMail = Server.CreateObject("JMail.Message")
JMail.From = strEmail
JMail.Subject = strSubject
JMail.Body = strComments
JMail.AddRecipient "general@aspwebpro.com"
JMail.Priority = 3 ' =3 Normal



IF NOT JMail.Send ("localhost") THEN
Response.Write( "ERROR MESSAGE: " & JMail.ErrorMessage & "
" & vbcrlf )
Response.Write( "ERROR SOURCE: " & JMail.ErrorSource & "
" & vbcrlf )
Response.Write( "LOG:
" & JMail.Log & "
" & vbcrlf )
ELSE
Response.Write "
Your :" & strSubject & " Newsletter has been successfully sent to " & intSubscribers & " subscribers.
"
END IF

Set JMail=Nothing

%>

  • 0 Los Usuarios han Encontrado Esto Útil
¿Fue útil la respuesta?