Connecting Tech Pros Worldwide Help | Site Map

How to send mail using Coldfusion

  #1  
Old October 22nd, 2007, 12:10 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,517
How to Send Mail in Coldfusion

You can use Coldfusion to easily send mail. From simple plain text emails to more complex HTML and multipart emails, the job is made a lot easier with Coldfusion.

In the following collection of articles, we will cover the basics and gradually move onto more useful examples including using a query to send mail to multiple recipients.

The <cfmail> tag

If you want to send email in Coldfusion, the cfmail tag is your friend.

Assuming everything is set up, the tag is very easy to use. Some of the more common attributes are given below:
Expand|Select|Wrap|Line Numbers
  1. <cfmail
  2. to="recipient"
  3. from="sender"
  4. subject="msg_subject"
  5. cc="copy_to"
  6. bcc="blind_copy_to">
Only the first three attributes are required, the rest are optional. For the full list of attributes, see the cfmail documentation. The following code demonstrates an example of this tag's use:
Expand|Select|Wrap|Line Numbers
  1. <cfmail
  2. to="someone@example.com"
  3. from="me@company.com"
  4. subject="Test Email">
  5. This is a test email.
  6. </cfmail>
We will deal with more advanced examples and uses of the cfmail tag later.



Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Links to popular tutorials acoder insights 7 May 5th, 2008 11:43 AM
ColdFusion Form - Interdependent validation pburkhart answers 3 January 11th, 2008 09:34 AM
How to prevent website from being hacked into MistiBaban answers 25 October 3rd, 2007 02:29 PM
Calling an coldfusion template from a ASP script John Reid answers 4 July 19th, 2005 06:52 AM