Ver Mensaje Individual
  #32 (permalink)  
Antiguo 08/11/2004, 10:18
Avatar de Saruman
Saruman
 
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
ASP Mail y JMail

Aqui hay dos funciones para enviar e-mails utilizando dos de los métodos más famosos....

Enjoy

Código:
<%
sub SendEmail(de, nick, para, asunto, mensaje)
		Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
		
		with Mailer
			.FromName = FromName
			.FromAddress = de
			.RemoteHost = RemoteHost
			.AddRecipient nick, para
			.Subject = asunto
			.ContentType = "text/html"
			.BodyText = mensaje
			if .SendMail = false then
				response.write("Error al enviar el E-Mail:<br>")
				response.write("<strong>Mensaje: </strong>" & .Response & "<br>")
			end if
		end with
		
		set Mailer = nothing
	end sub
	
	sub SendJMailEmail(de, nick, para, asunto, mensaje)
		Set objJMail = Server.CreateObject("JMail.SMTPMail")
		if isnumeric(body_tipo) = false then body_tipo = 0
		
		with objJMail
			.ServerAddress = RemoteHost
			.Sender = de
			.SenderName = nick
			.AddRecipient para
			.Subject = asunto
			if body_tipo = 1 then
				.Body = mensaje
			else
				.HTMLBody = mensaje
			end if
			.Silent = True
			.Priority = 3
			bSuccess = .Execute()
			if bSuccess = false then
				response.write("Error al enviar el E-Mail:<br>")
				response.write("<strong>Código: </strong>" & .ErrorCode & "<br>")
				response.write("<strong>Mensaje: </strong>" & .ErrorMessage & "<br>")
			end if
		end with
		
		Set objJMail = Nothing
	end sub
%>

se utiliza asi:

ASP Mail

Código:
call SendEmail(de, nick, para, asunto, mensaje)
J Mail

Código:
call SendJMailEmail(de, nick, para, asunto, mensaje)
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.

Última edición por Saruman; 08/11/2004 a las 10:19