Picture of Paul Silver

Paul Silver

Making websites for companies and helping advertise them

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


Paul Silver. November 2003

© 2024 Paul Silver & Silver Web Services Ltd