How you can send email using Coldfusion and CFmail

How do I use the CFMail tag to send mail from my ColdFusion pages?

The following article explains how to use the CFMail tag. This tag allows you to send email messages through your website. This tag is available for use on all of our shared Coldfusion hosting accounts.

The syntax of the cfmail tag is very simple. Within the tag you add the pertinent information including the to address, the from address, a subject line and the server name. The server name will be localhost. The message of the email is placed between the cfmail tags.

Below is an example of the CFMail tag for versions of ColdFusion starting with ColdFusion 5.0

CFMail tag using Coldfusion 5.0

<cfmail
to ="name@yourdomain.com"
from = "name@yourdomain.com"
subject = "Example of CFMail Tag using Coldfusion 5.0"
server = "localhost">

Email Message
</cfmail>
CFMail tag using Coldfusion MX 6.1 / 7.0 / 8
<cfmail
to =" name@yourdomain.com"
from = "name@yourdomain.com"
subject = "Example of CFMail Tag using Coldfusion"
server = "localhost"
username = "name@yourdomain.com"
password = "password">

Email Message
</cfmail>

Coldfusion MX 6.1/CFMX 7/CF 8 allows for SMTP Authentication by use of a username and password. The username and password must be a valid email address from your mail account.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Arizona Website Development by: OSEKmedia, llc
Blog Powered by: BlogCFC, version 5.9.002