Send e-mail via ColdFusion with importance set to high

A client wanted me to send e-mail to their staff which would show up as if he'd sent it with 'Importance: High' set - which gives a little red '!' next to the message.

To do this you need to use the CFMAILPARAM tag inside a CFMAIL message.

<CFMAILPARAM NAME="X-Priority" VALUE="1"> will set the importance of the message as high, which will show up in Outlook as the red exclamation mark, and other e-mail reading programs will have their own indicators.

You'd use it in the code like this:

<CFMAIL TO="spam@spam.com"
FROM="morespam@spam.com"
SUBJECT="Urgent: Contact this client">
<CFMAILPARAM NAME="X-Priority" VALUE="1">

This client just requested contact through our website:

Joe Bloggs, 01234 567890

</CFMAIL>


Note: this does not make the e-mail go any faster. ColdFusion (at least v4 through 5) waits up to three minutes to send mail out to the server, it just gives an indicator to the person who receives it.

More code articles

Useful books
Cover of Mastering ColdFusion
Mastering ColdFusion MX
Amazon UK | USA
Cover of Programming ColdFusion MX
Programming ColdFusion MX
Amazon UK | USA
Cover of ColdFusion X Web Application Construction Kit
ColdFusion X Web Application Construction Kit
Amazon UK | USA

Paul Silver. November 2003


Silver Web Services Ltd

© 2017 Paul Silver