User Guide

cfmail 243
Usage
Sends a mail message to the specified address. Mail messages can include attachements. The tag
body can include CFML code to generate mail output. The
cfmailparam and cfmailpart tags
can only be used in the cfmail tag body.
Mail messages can be single or multipart. If you send a multi-part mail message, all message
content must be in
cfmailpart tags; ColdFusion ignores multipart message text text that is not
in
cfmailpart tags.
Note: The cfmail tag does not make copies of attachments when spooling mail to disk. If you use
the cfmail tag to send a message with an attachment with spooling enabled and you use the cffile
tag to delete the attachment file, ColdFusion might not send the mail because the mailing process
might execute after the file was is deleted. (When this happens, the mail log includes a FileNotFound
exception and the e-mail is not sent.) You can prevent this problem by setting SpoolEnable="No" in
the attribute or disabling spooling in the ColdFusion MX Administrator. Disabling spooling causes the
e-mail to be delivered immediately.
Mail addressing
Mail addresses can have any of the following forms:
port Optional TCP/IP port on which SMTP server listens for requests
(normally 25). A value here overrides the Administrator.
mailerID Optional ColdFusion
MX
Application
Server
Mailer ID to be passed in X-Mailer SMTP header, which
identifies the mailer application.
timeout Optional Number of seconds to wait before timing out connection to
SMTP server. A value here overrides the Administrator.
spoolEnable Optional Specifies whether to spool mail or always send it
Immediately. Overrides the ColdFusion MX Administrator
Spool mail messages to disk for delivery setting.
Yes: Saves a copy of the message until the sending
operation is complete. Pages that use this option might
run slower than those that use the
No option.
No: Queues the message for sending, without storing a
copy until the operation is complete. If a delivery error
occurs when this option is
No, ColdFusion generates an
Application exception and logs the error to the mail.log
file.
Format Example
user@server rsmith@company.com
<user@server> <rsmith@company.com>
DisplayName <user@server> Rob Smith <rsmith@company.com>
"DisplayName" <user@server> "Rob Smith" <rsmith@company.com>
user@server (DisplayName) rsmith@company.com (Rob Smith)
Attribute Req/Opt Default Description