Active Server Pages Tutorial

Sending E-mail using Collaboration Data Objects (CDO)

Collaboration Data Objects is an object library of the Messaging Application Programming Interface (MAPI). It is built into ASP and can be used, for example, to send e-mail:

<% Set HolidayMail=CreateObject(“CDO.Message”) HolidayMail.Subject=”Happy Valentine’s Day!” HolidayMail.From=”” HolidayMail.To=”” HolidayMail.TextBody=”Visit us for 50 tips on a romantic Valentine’s Day.” HolidayMail.Send %>

The TextBody property formats the body of the e-mail as text; you can use HTMLBody to format the body as HTML:


50 Tips for Valentine’s Day

CreateHTMLBody sends an HTML file:




Leave a Reply

Your email address will not be published. Required fields are marked *