![]() ![]() ![]() |
Before you set up ColdFusion to send email messages, you must have access to an SMTP email server. Also, before you run application pages that refer to the email server, you must configure the ColdFusion Administrator to use the SMTP server.
See the Administering ColdFusion Server book for more information on the Administrator's mail settings.
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.
![]() ![]() ![]() |
AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.