Using the CF_Mail tag.

We are now enabling a CFX tag to enable customers another option when sending mail. There really only needs to be a minor change in your CFMail tag in order for the new tag to work. The new tag is 'CF_mail'. This tag uses IIS to handle mail and doesn't have the issues that some of our customers have experienced with CFMail slowing the CF service or bottle necking the mail queue. Below is examples of how to code for the 'CF_Mail' tag. Send An Email The following code will send an email to bob@jones.com, fred@jones.com, and buddy@jones.com Hi, just wanted to announce that I've got a new cow! Send a personalized email using a database The next example selects email addresses from a query, and dynamically makes the TO list using CF's ValueList() function. This example will also send a multi-part message, because both TEXTMESSAGE and HTMLMESSAGE is specified. This will also generate a verbose logfile with the date in the filename. SELECT email, name FROM farmers Hi %name%, just wanted to announce that I've got a new cow. The following QUERY could be used to generate an address that looks like First Last with fields in a database named FirstName, LastName, and Email. Using this format recipients will see their name in the TO box of the message, instead of just the email address. SET CONCAT_NULL_YIELDS_NULL OFF SELECT firstname + ' ' + lastname + ' <' + email + '>' AS Email FROM users Note: SET CONCAT_NULL_YIELDS_NULL OFF is used to prevent SQL Server from making the result of the concatenation NULL if any of the fields are null. If your name, and email address fields do not allow nulls then you may remove that line. If your email address field allows NULL's and you are concatenating with a name, you should add an extra statement to the where clause that removes null addresses (eg WHERE email <> ''). The above example was designed for SQL Server, if you are running other servers check your database server's documentation. Using SMTP Authentication Add your SMTP username and password to the SERVER attribute using the pattern user:password@server:port Hi, just wanted to announce that I've got a new cow! Using Multiple SMTP Servers Add a comma seperated list of mail servers in the SERVER attribute using the pattern user:password@server:port user password and port are optional Hi, just wanted to announce that I've got a new cow! Sending an attachment Use the file attribute to specify an attachment. Hi, check out the attached picture of my new cow Embeding an image in HTML Email Use the CID attribute to embed an image into HTML message Hi, check out the picture of my new cow: Sending an alternative message part You want to send rich text email that can be read by AOL 6.0 users I got a new cow Adding a custom header Use the CF_MailAttachment tag to add a custom header to the email message. I got a new cow Setting the message importance You can set the Importance header to Low, Normal, or High. I got a new cow Setting the message Precedence Its a good idea to set the precedence to bulk when sending bulk email. I got a new cow


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 1499