Coldfusion Mail Script

In this short tutorial i will show you how to easily add mail functionality to your website using the cfmail tag. This script could be used to send newly registered users a confirmation email or could actually be developed into a full webmail system.

The first thing we need to do is create the basic tag.

<cfmail to="sample@sample.com" from="test@test.com"

subject="Welcome to my website!" type="html">


Body of message

</cfmail>

There we have the most basic script to send an email.

For those of you requiring extra functionality out of your site here is the syntax of the cfmail tag.

<cfmail
from = "e-mail address"
to = "comma-delimited list"
bcc = "comma-delimited list"
cc = "comma-delimited list"
charset = "character encoding"
debug = "yes|no"
failto = "e-mail address"
group = "query column"
groupcasesensitive = "yes|no"
mailerid = "header id"
maxrows = "integer"
mimeattach = "path"
password = "string"
port = "integer"
priority = "integer or string priority level"
query = "query name"
replyto = "e-mail address"
server = "SMTP server address"
spoolenable = "yes|no"
startrow = "query row number"
subject = "string"
timeout = "number of seconds"
type = "mime type"
username = "SMTP user ID"
useSSL = "yes|no"
useTLS = "yes|no"
wraptext = "column number">


(Optional) Mail message body and/or cfhttpparam tags

</cfmail>

Related Blog Entries

Comments

Archives By Subject

Advertising (4) [RSS]
Blog Design (1) [RSS]
CFProject Scripts (2) [RSS]
Coldfusion Charts (3) [RSS]
Coldfusion Functions (5) [RSS]
Coldfusion Overview (1) [RSS]
Coldfusion Tutorials (17) [RSS]
For Sale (2) [RSS]
Image Manipulation (1) [RSS]
Java (1) [RSS]
JavaScript (4) [RSS]
PHP (1) [RSS]
Railo (2) [RSS]
SQL (1) [RSS]
Useful Tools (3) [RSS]

Recent Comments

Hashing Passwords
Richard Lord said: You really need to salt the passwords before hashing them, otherwise you're exposed to a rainbow-tab... [More]

Using Railo and Resin with domain aliases
Jonny Shaw said: Thanks for that. I am already using <host regexp="(.+)"> <host-name>${ho... [More]

Using Railo and Resin with domain aliases
Gert Franz said: Hi Jonny, it's even easier if you do it this way: <host id="allmead.com" root-dir... [More]

BlogCFC on Railo
Jonny Shaw said: Thanks for the advice ray. I was surprised at how easily BlogCFC went accross to to railo. The onl... [More]

BlogCFC on Railo
Gert Franz said: Congratulations to your new websites. I just wanted to add two things: CFIMAGE and CFCHART are suppo... [More]

Recent Entries

No recent entries.
ColdFusion Blog | ColdFusion Hosting | ColdFusion Q & A