Search the Knowledgebase Browse by Category
      Home       Web Hosting       Web Hosting Guide       Sample Scripts (Windows)
   Using CDO (Collaboration Data Objects)

CDO is really an additional scripting interface to an existing Microsoft messaging model, the Messaging Application Programming Interface (MAPI). Collaborative Data Objects are made available through two CDO libraries. These libraries let you address programmable messaging objects (including folders, messages, recipient addresses, attachments, and other messaging components). These objects are extensions to the programmable objects, such as forms and controls.

A sample CDO code is displayed as follows :

<%
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = Server.CreateObject("CDO.configuration")
cdoConfig.Fields.Item(sch & "sendusing") = 2
cdoConfig.Fields.Item(sch & "smtpserver") = "127.0.0.1"
cdoConfig.fields.update

Set cdoMessage = Server.CreateObject("CDO.Message")
Set cdoMessage.Configuration = cdoConfig
cdoMessage.From = "whoever@yourdomain.com"
cdoMessage.To = "anybody@anydomain.com"
cdoMessage.Subject = "form test"
cdoMessage.HTMLBody = "Btext"
cdoMessage.Send
if Err.Number <> 0 then
SendMail = "Email send failed: " & Err.Description & "."
end if
Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>


Live Support

If you have any questions at all, please don't hesitate to contact us

+91.22.28663101, 66789456

To submit Support ticket, click here


     Related FAQs
Setting up feedback form using ASP
Using AspEmail in ASP and ASP.Net
Using CDO (Collaboration Data Objects)
Connecting to MsSQL using DSN (Windows)
Connecting to MsSQL using DSN-less connection (Windows only)
File upload using Asp and Asp.Net
MsSQL Server Connection Strings - ODBC, OLE DB