Componentes de envío de correos


Aquí tienes el resumen de la codificación de los diversos componentes de envío de mensajes que existen para ASP.

Componente "CDONTS"
'Su lo usas en IIS (CDONTS object)

Set msMail = CreateObject("CDONTS.NewMail")
With msMail
.BodyFormat = 0 'Set to 0 for HTML email, 1 for plain text.
.MailFormat = 0 'Set to 0 for HTML email, 1 for plain text.
.To = strTo
.From = strFromName & " <" & strFromAddress & ">"
.Subject = strSubject
.Body = strMessage
.Send
End With



Componente "CDOSYS"
'Su lo usas en IIS's (CDO object):

Dim conf
Set conf = Server.CreateObject("CDO.Configuration")
With conf.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strHost
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Update
End With


Set msMail = Server.CreateObject("CDO.Message")
With msMail
Set .Configuration = conf
.From = strFromName & " <" & strFromAddress & ">"
.To = strTo
.Subject = strSubject
.HTMLBody = strMessage
.Send
End With



Componente "AspMail"
'Si usas AspMail (http://www.serverobjects.com)

Set msMail = Server.CreateObject("SMTPsvg.Mailer")
With msMail
.ContentType = "text/html"
.RemoteHost = strHost
.FromName = strFromName
.FromAddress = strFromAddress
.AddRecipient "", strTo
.Subject = strSubject
.BodyText = strMessage
.SendMail
End With



Componente "AspEmail"
'Si usas AspEmail 5.0 (http://www.aspemail.com):

Set msMail = Server.CreateObject("Persits.MailSender")
With msMail
.Host = strHost
.From = strFromAddress
.FromName = strFromName
.AddAddress strTo
.Subject = strSubject
.Body = strMessage
.IsHTML = True
.Send
End With



Componente "Geocel"
'Si usas Geocel DevMailer 1.5 (http://www.geocel.com):

Set msMail = Server.CreateObject("Geocel.Mailer")
With msMail
.AddServer strHost, 25
.FromAddress = strFromAddress
.FromName = strFromName
.AddRecipient strTo, ""
.Subject = strSubject
.Body = strMessage
.ContentType = "text/html"
.LogLevel = 4
.LogFile = "c:\temp\emailcoms\geocel.log"
.Send
End With



Componente "JMail"
'Si usas JMail (http://tech.dimac.net)

Set msMail = Server.CreateOBject("JMail.Message")
With msMail
.From = strFromAddress
.FromName = strFromName
.AddRecipient strTo
.Subject = strSubject
.HTMLBody = strMessage
.Send(strHost)
End With



Componente "DynuEmail"
'Si usas DynuEmail (http://www.dynu.com)

Set msMail = Server.CreateObject("Dynu.Email")
With msMail
.Host = strHost
.IsHTML = True
.From = strFromAddress
.FromName = strFromName
.AddAddress strTo
.Subject = strSubject
.Body = strMessage
.Send()
End With



Componente "EasyMail"
'Si usas EasyMail 5 (http://www.easymailobjects.com)

Set msMail = Server.CreateObject("EasyMail.SMTP.5")
With msMail
.MailServer = strHost
.BodyFormat = 1 'For HTML
.FromAddr = strFromAddress
.AddRecipient "", strTo, 1
.Subject = strSubject
.Send()
End With



Componente "SA-SMTPMail"
'Si usas SA-SMTPMAIL (http://www.aspstudio.com)

Set msMail = Server.CreateObject("SoftArtisans.SMTPMail")
With msMail
.RemoteHost = strHost
.FromAddress = strFromAddress
.FromName = strFromName
.AddRecipient strTo
.Subject = strSubject
.HTMLText = strMessage
.Wordwrap = True
.SendMail
End With



Componente "ocxQmail"
'Si usas ocxQmail (http://www.flicks.com/ocxQmail)

Set msMail = Server.CreateObject("ocxQmail.ocxQmailCtrl.1")
msMail.XHeader "Content-Type", "text/html; charset=""iso-8859-1"""
msMail.Q strHost, strFromName, strFromAddress, "", "", strTo, "", "", "", strSubject, strMessage
End Select