CDONTS stands for "Collaboration Data Objects for Windows NT Server" and as the name suggests it is for NT. The CDONTS component is installed when you install IIS on NT4, Windows 2000 and Windows 2003 servers.
Although, the component will run on Windows XP, Microsoft has decided to remove the component from IIS 5.1 on Windows XP, so you will have to track down a copy of the cdonts.dll and register it on the IIS web server.
To use this component to send an e-mail, you also need the SMTP Server that ships with IIS 4 or 5 installed on the web server. The SMTP server is usually installed by default with the standard IIS installation.
Note: This may please be noted that this component can be uniformly used by all the users of Windows Shared Hosting and Windows VPS (2003 OS).
Although, the component will run on Windows XP, Microsoft has decided to remove the component from IIS 5.1 on Windows XP, so you will have to track down a copy of the cdonts.dll and register it on the IIS web server.
To use this component to send an e-mail, you also need the SMTP Server that ships with IIS 4 or 5 installed on the web server. The SMTP server is usually installed by default with the standard IIS installation.
Sample code:
- <%
- Dim objCDOMail
- Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
- objCDOMail.From = "[email protected]"
- objCDOMail.To = "[email protected]"
- objCDOMail.Cc = "[email protected]"
- objCDOMail.Bcc = "[email protected]"
- objCDOMail.Subject = "Subject"
- objCDOMail.BodyFormat = 0
- objCDOMail.MailFormat = 0
- objCDOMail.Body = "MailBody"
- objCDOMail.Importance = 1
- objCDOMail.Send
- Set objCDOMail = Nothing
- %>
Explanation according to line:
- Open ASP tag
- Declare a variable named objCDOMail
- Create instance of Mailer control
- Set Mailer control properties and collection items
- Set Mailer control properties and collection items
- Set Mailer control properties and collection items
- Set Mailer control properties and collection items
- Set Mailer control properties and collection items
- Set Mailer control properties and collection items
- Set Mailer control properties and collection items
- Set Mailer control properties and collection items
- Set Mailer control properties and collection items
- Send Mail
- Release resources
- Close ASP tag
Note: This may please be noted that this component can be uniformly used by all the users of Windows Shared Hosting and Windows VPS (2003 OS).
Looking to send emails using CDO? Click on Send > CDO Email for more details.