|
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
%> |