ColdFusion Tutorial
Using ColdFusion to send e-mail cfmail
The <cfmail> tag is not a new ColdFusion tag. It's been part of the CFML language since the earliest versions of the application server. But it has been constantly improved and updated with each new release of ColdFusion.
Ease of use:
We start by building a basic, plain-text e-mail message.
Basically, <cfmail> is used like this:
|
< cfmail to="" from="" subject="" server="">Message body. </ cfmail> |
Creating an Plain Text e-mail:
|
< cfmail to="#toAddress#" from="#fromAddress#" subject="Testing a Plain Text Message" server="#mailServer#" timeout="10" replyto="#replyToAddress#" failto="#failTo#" type="Plain Text">Write your message body here in ?Plain Text?. </ cfmail> |
Creating an HTML-formatted e-mail:
|
< cfmail to="#toAddress#" from="#fromAddress#" subject="Testing an HTML Message" server="#mailServer#" timeout="10" replyto="#replyToAddress#" failto="#failTo#" type="HTML"><! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">< html>< head>< meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">< title>My HTML Message</title>< style type="text/css"><!-- body { background-color: #66CCCC; font-family: Georgia, "Times New Roman", Times, serif; font-size: 12px; font-style: normal;} -- ></ style></ head>< body>< p align="center">This is your HTML message with background color, fonts, links and images. <br> <br>Here is a link to ScandicSoft. <br> <br>And an site logo. <br> <img src="http://www.applayit.com/images/scandicsoft_logo_smal.gif"></ body></ html></ cfmail> |
Conclusion:
The easy use of ColdFusion <cfmail> make it easy to integrating e-mail capabilities into your Web application this is a common requirement. The ubiquity of e-mail makes it an ideal way to correspond with users and customers, as well as to send files in the form of e-mail attachments.
|
< cfmail to = "recipient" from = "sender" cc = "copy_to" bcc = "blind_copy_to" subject = "msg_subject" replyto = "reply_to_addr" failto = "fail_message_addr" username = "user name" password = "password" wraptext = "column number" charset = "character encoding" type = "msg_type" mimeattach = "path" query = "query_name" group = "query_column" groupcasesensitive = "yes" or "no" startrow = "query_row" maxrows = "max_msgs" server = "serverspecs" port = "port_id" mailerid = "headerid" timeout = "seconds" spoolenable = "yes" or "no">(Optional) Mail message body and/or cfhttpparam tags </ cfmail> |
ColdFusion Tutorial test
Using ColdFusion to send e-mail cfmail
No test is available or implemented for this ColdFusion Tutorial.
No User Comments.
No User Comments, be the first one to write your comments?
