HOWTO: Send a mail using CDOSYS

 <%
 'Dimension variables
 Dim objCDOSYSCon 
 
  'Create the e-mail server object
 Set objCDOSYSMail = Server.CreateObject("CDO.Message")
 Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
 
 'Out going SMTP server 
 objCDOSYSCon.Fields("
http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"  
 objCDOSYSCon.Fields("
http://schemas.microsoft.com/cdo/configuration/smtpserverport")  = 25  
 objCDOSYSCon.Fields("
http://schemas.microsoft.com/cdo/configuration/sendusing") = 2  
 objCDOSYSCon.Fields("
http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60  
 objCDOSYSCon.Fields.Update 
 
 'Update the CDOSYS Configuration
 Set objCDOSYSMail.Configuration = objCDOSYSCon
 
 objCDOSYSMail.From = "
you@yoursite.com"  
 objCDOSYSMail.To = "
someone@theresite.com"  
 objCDOSYSMail.Subject = "Subject goes here"  
 objCDOSYSMail.HTMLBody = "html enhanced email message goes here"  
 
 objCDOSYSMail.Send  
 
 'Close the server mail object 
 Set objCDOSYSMail = Nothing
 Set objCDOSYSCon = Nothing
 %> 
 
  • 1971 Users Found This Useful
Was this answer helpful?

Related Articles

HOWTO: Send a mail using CDONTS

<%'declare variables for the mail object (oMail) and the email body (strEmailBody) Dim oMail,...

HOWTO: Use the Whois DLL Component

OverviewWhoisDLL is a Whois COM object that makes querying domain names a lot easier. The whois...