The CFMAIL tag provides support for sending SMTP (Simple Mail Transfer Protocol) email from within ColdFusion applications. The CFMAIL tag is similar to the CFOUTPUT tag, except that CFMAIL outputs the generated text as SMTP mail messages rather than to the display screen. All attributes and commands you use with CFOUTPUT you can also use with CFMAIL.
Here's an example of a basic use of the CFMAIL tag, using form variables to resolve the From, To, Subject, and message body components of the mail message.
<CFMAIL QUERY="GetList"
TO="#Email#"
FROM="Sales DepartmentList Manager"
SUBJECT="#Form.Subject#">
#FORM.Body#
</CFMAIL>
More detailed examples follow in subsequent sections. Also, see the CFML Language Reference for a full catalog of the CFMAIL tag's attributes and values.
|