Setting Properties And Invoking Methods - MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual

Table of Contents

Advertisement

Creating and Using COM Objects

Setting properties and invoking methods

The following example, using the sample Mailer COM object, shows how to assign
properties to the mail message you want to send and how to execute component
methods to handle mail messages.
In the example, form variables provide method parameters and properties, such as
the name of the recipient, the desired e-mail address, and so on.
<!--- First, create the object --->
<cfobject type="COM"
<!--- Then, use the form variables from the user entry form to
<cfset Mailer.From = "#Form.fromName#">
<cfset Mailer.To = "#Form.to#">
<cfset Mailer.Subject = "#Form.subject#">
<cfset Mailer.Importance = 2>
<cfset Mailer.Body = "#Form.body#">
<cfset Mailer.Cc = "#Form.cc#">
<!--- Last, use the Send() method to send the message.
<cfset Mailer.Send()>
Note
Use the
more information on exception handling, see "Handling Exceptions in ColdFusion"
on page 204.
An out-of-process server object (typically an exe file) that is running
local
outside the ColdFusion process space but running locally on the same server.
An out-of-process server object (typically an exe file) that is running
remote
remotely on the network. If you specify
attribute to identify where the object resides.
action="Create"
name="Mailer"
class="CDONTS.NewMail">
populate a number of properties necessary to create and send the
message. --->
Invoking the Send() method destroys the object.--->
and
cftry
cfcatch
remote
tags to handle exceptions thrown by COM objects. For
, you must also use the
375
server

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 5

Table of Contents