Change language to English
  Buscar un Dominio
 
  Detalles Ayuda General.
CDOSYS (formerly CDONTS)

The CDOSYS mailing component is supported and recommended. Below is an example of how to use the mailing component in ASP:


Dim Subject, Body, SenderEmail, RecipientEmail, SMTPServer, SMTPusername, SMTPpassword

SenderEmail = "me@mydomain.tld"
RecipientEmail= "someone@somedomain.tld"
SMTPserver = "mail.mydomain.tld"
SMTPusername = "me@mydomain.tld"
SMTPpassword = "mypassword"

Subject = "Hello"
Body = "This is a test. Please ignore."


sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "sendusing") = 2
.Item(sch & "smtpserver") = SMTPserver
.Item(sch & "smtpserverport") = 25
.Item(sch & "smtpauthenticate") = 1
.Item(sch & "sendusername") = SMTPusername
.Item(sch & "sendpassword") = SMTPpassword
.Item(sch & "smtpusessl") = False
.Item(sch & "connectiontimeout") = 100
.update
End With
Const cdoSendUsingPickup = "c:\inetpub\mailroot\pickup"
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
cdoMessage.From = SenderEmail
cdoMessage.To = RecipientEmail
cdoMessage.Subject = Subject
cdoMessage.TextBody = Body
cdoMessage.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing