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 (3) [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]
Useful Tools (3) [RSS]

Recent Comments

Coldfusion and Java
Henry Ho said: I'm more interested in writing Groovy with CFGroovy. I think you may want to look into that as well... [More]

Coldfusion and Java
Jeremy P said: Since CF is build on Java, it's very easy/handy to use it. I recently had to "drop down"... [More]

Coldfusion and Java
Kumar said: Similarly to what Ben said, we have used Java objects in ColdFusion to perform certain tasks. Dan V... [More]

Coldfusion and Java
Ben Nadel said: I use Java objects in ColdFusion all the time. The CreateObject( "java" ) method makes it ... [More]

Coldfusion and Java
Steve Brownlee said: Yes, I can provide some advantages, but that's a large discussion. It can provide speed advantages ... [More]

Recent Entries

Coldfusion and Java
Coldfusion Hosting From £2.50
Coldfusion Blog | Coldfusion Hosting | About Me