![MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Скачать руководство пользователя страница 233](http://html1.mh-extra.com/html/macromedia/coldfusion-4-5-developing-web/coldfusion-4-5-developing-web_develop-manual_3286369233.webp)
Chapter 13: Sending and Receiving Email
207
Sending SMTP mail with CFMAIL
The CFMAIL tag provides support for sending SMTP 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 a page. You can use
all the attributes and commands that you use with CFOUTPUT with CFMAIL as well.
To send a simple email message:
1.
Create a new file in Studio.
2.
Modify the file so that it appears as follows:
<HTML>
<HEAD>
<TITLE>Sending a simple email</TITLE>
</HEAD>
<BODY>
<H1>Sample email</H1>
<CFMAIL
FROM="[email protected]"
TO="#URL.email#"
SUBJECT="Sample email"
>
This is a sample email to show basic email capability.
</CFMAIL>
The email was sent.
</BODY>
</HTML>
3.
Save the file as
sendmail.cfm
in
myapps
under the Web root directory.
4.
Open your browser and enter the URL that contains the file. Replace
with you email address
.
For example,
http://localhost/myapps/[email protected]
The template sends the email to you, through your SMTP server.
Samples uses of CFMAIL
An application page with the CFMAIL tag dynamically generates email messages based
on the tag’s settings. Some of the things you can accomplish with CFMAIL are:
•
Send a mail message whose recipient and contents are determined by data the
user enters in an HTML form.
•
Use a query to send a mail message to a database-driven list of recipients.
Содержание COLDFUSION 4.5-DEVELOPING WEB
Страница 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Страница 14: ...xiv Developing Web Applications with ColdFusion...
Страница 26: ...xxvi Developing Web Applications with ColdFusion...
Страница 34: ...8 Developing Web Applications with ColdFusion...
Страница 70: ...44 Developing Web Applications with ColdFusion...
Страница 84: ...58 Developing Web Applications with ColdFusion...
Страница 114: ...88 Developing Web Applications with ColdFusion...
Страница 148: ...122 Developing Web Applications with ColdFusion...
Страница 174: ...148 Developing Web Applications with ColdFusion...
Страница 208: ...182 Developing Web Applications with ColdFusion...
Страница 244: ...218 Developing Web Applications with ColdFusion...
Страница 274: ...248 Developing Web Applications with ColdFusion...
Страница 288: ...262 Developing Web Applications with ColdFusion...
Страница 300: ...274 Developing Web Applications with ColdFusion...
Страница 350: ...324 Developing Web Applications with ColdFusion...
Страница 362: ...336 Developing Web Applications with ColdFusion...