|By Ben Forta||
|September 11, 2003 12:00 AM EDT||
One of the most used tags in CFML is <CFMAIL>. It is definitely the most used of all the Internet protocol tags, and as one of the original CFML tags (it was actually one of the DBML tags and originally named <DBMAIL>), it has also been slowly enhanced and updated with each new release of ColdFusion. Slowly. Maybe a little too slowly.
ColdFusion MX 6.1 introduces a whole new <CFMAIL>, a much better and much more powerful <CFMAIL>, and this month I'd like to walk you through these important changes.
Let's start with performance. <CFMAIL> was never designed to be a high-performance mass mailer, and yet many developers have tried using it as just that. <CFMAIL> has always been very capable of delivering hundreds, even thousands, of messages, but that's about as far as the tag could be pushed.
ColdFusion MX 6.1 introduces important changes to the <CFMAIL> engine that facilitate dramatically increased mail-delivery performance. In fact, in testing, we clocked <CFMAIL> on a fairly typical box delivering mail at over 1,000,000 messages an hour (so fast that the bottleneck became the network and mail server rather than ColdFusion).
So what changed? Two things:
<CFMAIL> performance has been improved in all versions of ColdFusion, but if you need high-volume mail delivery, then you should be using ColdFusion MX Enterprise. The two changes just described apply to ColdFusion MX Enterprise only.
One frequently requested <CFMAIL> enhancement is support for backup SMTP servers so that if a mail server is down, a backup SMTP server would be used. Support for redundant (backup) SMTP servers has been added to ColdFusion MX 6.1 Enterprise (this too is an Enterprise-only feature).
ColdFusion Administrator contains a new field (in the Mail page) named "Backup mail servers". You may specify as many servers as you like here (DNS names or IP addresses) in a comma-delimited format (you may also list backup servers right in the <CFMAIL> tag SERVER attribute). The specified servers are the backup servers, and will be used automatically if the primary SMTP server is unavailable.
It is important to note that <CFMAIL> does not support multiple mail server delivery. These additional servers are backup servers and are used only if the primary server is unavailable. If a server (any server) is unavailable, then ColdFusion will attempt to use the next server in the list. Once a server has been flagged as unavailable, ColdFusion will not attempt to use it again for 60 seconds. If all servers are unavailable, then an error is logged.
Like the high-performance features discussed above, the ability to specify backup SMTP servers is an Enterprise-only feature. (From this point on, however, everything discussed applies to all versions of ColdFusion, including ColdFusion MX Standard).
SMTP was never designed to a be a secure protocol. As we are all painfully aware, you can never really be sure who mail comes from and whether or not a FROM field contains the actual sender address. It's all too easy to submit fake SMTP e-mail to mail servers for processing.
In recent years, mail administrators have started taking steps to prevent their servers from being used to deliver unauthorized mail (commonly known as relaying). One technique that has gained popularity is to require an SMTP login. Unlike POP, which always requires a login, SMTP usually does not, but many SMTP servers now do require that login credentials be passed in in order to deliver outbound mail. If enabled, this security prevented the use of <CFMAIL>, as <CFMAIL> provided no way to specify login information.
ColdFusion MX 6.1 supports SMTP logins in two ways:
The ability to use SMTP logins is an important enhancement, and one that will make many server administrators very happy.
Multiple MIME Types
One of the most eagerly anticipated <CFMAIL> enhancements is the ability to include multiple bodies of different MIME types all in a single message. What does this mean? Consider the following:
You deliver reports via <CFMAIL>. Your reports are detailed, have columns, colors and fonts, use images, and more, and so you tell <CFMAIL> to deliver the e-mail in HTML, as most mail clients, including Outlook and Outlook Express, support HTML e-mail. The problem, however, is that not all users have mail clients capable of displaying HTML e-mail, so you also need to generate a plain-text version of your report for those users. Of course, this then requires that you maintain a record of which version to send to which user (probably a flag in your database). You'd need a way for users to specify the message type they'd like, and then mail generation code that might look a bit like this:
<!--- Check HTML mail flag --->
<!--- Send HTML version --->
<!--- Send text version --->
You'd need to repeat everything, not to mention maintaining the user mail preferences. You'd also not be able to use the <CFMAIL> query attribute easily, or you'd need two queries - one for text message recipients and one for HTML message recipients - and then you'd need two <CFMAIL> tags (one for each query).
There's a better way to do this. E-mail messages can actually contain multiple bodies, each of a different MIME type. The problem is that <CFMAIL> did not support the use of this feature. Until now, that is. Here's the ColdFusion MX 6.1 version of the previous example:
<!--- Generate mail message --->
<!--- Generate text body --->
Text body goes here
<!--- Generate HTML body --->
<B>HTML body goes here</B>
As you can see, a single <CFMAIL> tag is being used along with two instances of a new tag named <CFMAILPART>. This new tag allows you to embed multiple bodies in a single message, as long as each has a different MIME type. This way it is the mail client that decides which body to display, and this makes your life a bit simpler. (It also means that your mail messages will be bigger; you'll need to decide whether or not this is acceptable.)
Any and all MIME types are supported, although in practice you'll probably use only TEXT and HTML.
Note: Although we're just covering <CFMAIL> in this column, it's worth noting that <CFPOP> has been similarly enhanced and now supports the retrieval of multiple bodies as well.
In addition to all the changes listed thus far, <CFMAIL> also features lots of little enhancements. Some worth noting are:
<CFMAIL> is an important ColdFusion tag and ranks as one of the most used tags in the CFML language. For high performance and high-availability mail delivery you should definitely consider using ColdFusion MX Enterprise. For all users, the enhancements to this tag in ColdFusion MX 6.1 provide yet another compelling reason to upgrade.
On a totally separate note, this is my 50th CFDJ <BF> on <CF> column - that's 50 back-to-back columns (with only one exception, and I'll try not to let that happen again). While writing this column, I glanced at the topics covered since way back when, and was reminded of just how far ColdFusion has come in such a short time. It's been a great ride thus far, here's to another 50!
|ant 10/09/03 12:10:35 PM EDT|
While much of the new cfmail functionality is great, it comes at a price - The inability to write a text file into email directly from a database or other source. All I had to do was create a boundary and header and add that text in between my cfmail call like so:
After the "upgrade" only cfmailparam worked - back to cfdirectory/cffile calls - more overhead and unnecesary code. The new cfmailpart doesn't allow for attachements like this - ONLY inline content. Oh well, 2 steps forward, one step back...
|Craig Overpeck 09/24/03 12:51:24 PM EDT|
It cut our hardware scaling solution in half. BF is right - a long awaited but noteworthy accomplishment by Alliare...I mean Macromedia. Congrats on number 50 BF!
|prethi 09/24/03 08:33:59 AM EDT|
can i have a sample of cfmail. I have hosted with cfmresources but am not able to send mails.
|Fran Garland 09/24/03 08:31:25 AM EDT|
Yes CFMail has come a long way.
I intend to use some of this new functionalily on my companies web site.
In addition it give me more fodder to upgrade the one server not on the CFMX 6.0 En since the setting staying connected in only available in this version. Enjoyed the article
As businesses adopt functionalities in cloud computing, it’s imperative that IT operations consistently ensure cloud systems work correctly – all of the time, and to their best capabilities. In his session at @BigDataExpo, Bernd Harzog, CEO and founder of OpsDataStore, will present an industry answer to the common question, “Are you running IT operations as efficiently and as cost effectively as you need to?” He will expound on the industry issues he frequently came up against as an analyst, and...
Mar. 30, 2017 08:00 PM EDT Reads: 4,440
Your homes and cars can be automated and self-serviced. Why can't your storage? From simply asking questions to analyze and troubleshoot your infrastructure, to provisioning storage with snapshots, recovery and replication, your wildest sci-fi dream has come true. In his session at @DevOpsSummit at 20th Cloud Expo, Dan Florea, Director of Product Management at Tintri, will provide a ChatOps demo where you can talk to your storage and manage it from anywhere, through Slack and similar services ...
Mar. 30, 2017 07:15 PM EDT Reads: 4,643
SYS-CON Events announced today that HTBase will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. HTBase (Gartner 2016 Cool Vendor) delivers a Composable IT infrastructure solution architected for agility and increased efficiency. It turns compute, storage, and fabric into fluid pools of resources that are easily composed and re-composed to meet each application’s needs. With HTBase, companies can quickly prov...
Mar. 30, 2017 04:30 PM EDT Reads: 3,549
SYS-CON Events announced today that Linux Academy, the foremost online Linux and cloud training platform and community, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Linux Academy was founded on the belief that providing high-quality, in-depth training should be available at an affordable price. Industry leaders in quality training, provided services, and student certification passes, its goal is to c...
Mar. 30, 2017 04:15 PM EDT Reads: 4,442
SYS-CON Events announced today that SoftLayer, an IBM Company, has been named “Gold Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2016, at the Javits Center in New York, New York. SoftLayer, an IBM Company, provides cloud infrastructure as a service from a growing number of data centers and network points of presence around the world. SoftLayer’s customers range from Web startups to global enterprises.
Mar. 30, 2017 03:30 PM EDT Reads: 2,459
In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), will provide an overview of various initiatives to certifiy the security of connected devices and future trends in ensuring public trust of IoT. Eric Lachapelle is the Chief Executive Officer of the Professional Evaluation and Certification Board (PECB), an international certification body. His role is to help companies and individuals to achieve professional, accredited and worldw...
Mar. 30, 2017 03:15 PM EDT Reads: 1,125
SYS-CON Events announced today that Technologic Systems Inc., an embedded systems solutions company, will exhibit at SYS-CON's @ThingsExpo, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Technologic Systems is an embedded systems company with headquarters in Fountain Hills, Arizona. They have been in business for 32 years, helping more than 8,000 OEM customers and building over a hundred COTS products that have never been discontinued. Technologic Systems’ pr...
Mar. 30, 2017 02:45 PM EDT Reads: 4,061
SYS-CON Events announced today that Auditwerx will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Auditwerx specializes in SOC 1, SOC 2, and SOC 3 attestation services throughout the U.S. and Canada. As a division of Carr, Riggs & Ingram (CRI), one of the top 20 largest CPA firms nationally, you can expect the resources, skills, and experience of a much larger firm combined with the accessibility and attent...
Mar. 30, 2017 02:45 PM EDT Reads: 1,093
SYS-CON Events announced today that CA Technologies has been named “Platinum Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY, and the 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CA Technologies helps customers succeed in a future where every business – from apparel to energy – is being rewritten by software. From ...
Mar. 30, 2017 02:45 PM EDT Reads: 2,535
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend @CloudExpo | @ThingsExpo, June 6-8, 2017, at the Javits Center in New York City, NY and October 31 - November 2, 2017, Santa Clara Convention Center, CA. Learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
Mar. 30, 2017 02:00 PM EDT Reads: 9,078
SYS-CON Events announced today that Loom Systems will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Founded in 2015, Loom Systems delivers an advanced AI solution to predict and prevent problems in the digital business. Loom stands alone in the industry as an AI analysis platform requiring no prior math knowledge from operators, leveraging the existing staff to succeed in the digital era. With offices in S...
Mar. 30, 2017 01:45 PM EDT Reads: 1,953
SYS-CON Events announced today that T-Mobile will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. As America's Un-carrier, T-Mobile US, Inc., is redefining the way consumers and businesses buy wireless services through leading product and service innovation. The Company's advanced nationwide 4G LTE network delivers outstanding wireless experiences to 67.4 million customers who are unwilling to compromise on ...
Mar. 30, 2017 12:00 PM EDT Reads: 2,795
SYS-CON Events announced today that Infranics will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Since 2000, Infranics has developed SysMaster Suite, which is required for the stable and efficient management of ICT infrastructure. The ICT management solution developed and provided by Infranics continues to add intelligence to the ICT infrastructure through the IMC (Infra Management Cycle) based on mathemat...
Mar. 30, 2017 11:15 AM EDT Reads: 3,738
SYS-CON Events announced today that Interoute, owner-operator of one of Europe's largest networks and a global cloud services platform, has been named “Bronze Sponsor” of SYS-CON's 20th Cloud Expo, which will take place on June 6-8, 2017 at the Javits Center in New York, New York. Interoute is the owner-operator of one of Europe's largest networks and a global cloud services platform which encompasses 12 data centers, 14 virtual data centers and 31 colocation centers, with connections to 195 add...
Mar. 30, 2017 10:30 AM EDT Reads: 2,011
SYS-CON Events announced today that Cloudistics, an on-premises cloud computing company, has been named “Bronze Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Cloudistics delivers a complete public cloud experience with composable on-premises infrastructures to medium and large enterprises. Its software-defined technology natively converges network, storage, compute, virtualization, and management into a ...
Mar. 30, 2017 10:15 AM EDT Reads: 2,555
SYS-CON Events announced today that SD Times | BZ Media has been named “Media Sponsor” of SYS-CON's 20th International Cloud Expo, which will take place on June 6–8, 2017, at the Javits Center in New York City, NY. BZ Media LLC is a high-tech media company that produces technical conferences and expositions, and publishes a magazine, newsletters and websites in the software development, SharePoint, mobile development and commercial UAV markets.
Mar. 30, 2017 10:00 AM EDT Reads: 4,617
"I think that everyone recognizes that for IoT to really realize its full potential and value that it is about creating ecosystems and marketplaces and that no single vendor is able to support what is required," explained Esmeralda Swartz, VP, Marketing Enterprise and Cloud at Ericsson, in this SYS-CON.tv interview at @ThingsExpo, held June 7-9, 2016, at the Javits Center in New York City, NY.
Mar. 30, 2017 08:00 AM EDT Reads: 4,716
Why do your mobile transformations need to happen today? Mobile is the strategy that enterprise transformation centers on to drive customer engagement. In his general session at @ThingsExpo, Roger Woods, Director, Mobile Product & Strategy – Adobe Marketing Cloud, covered key IoT and mobile trends that are forcing mobile transformation, key components of a solid mobile strategy and explored how brands are effectively driving mobile change throughout the enterprise.
Mar. 30, 2017 06:00 AM EDT Reads: 3,283
My team embarked on building a data lake for our sales and marketing data to better understand customer journeys. This required building a hybrid data pipeline to connect our cloud CRM with the new Hadoop Data Lake. One challenge is that IT was not in a position to provide support until we proved value and marketing did not have the experience, so we embarked on the journey ourselves within the product marketing team for our line of business within Progress. In his session at @BigDataExpo, Sum...
Mar. 30, 2017 04:45 AM EDT Reads: 3,525
Keeping pace with advancements in software delivery processes and tooling is taxing even for the most proficient organizations. Point tools, platforms, open source and the increasing adoption of private and public cloud services requires strong engineering rigor - all in the face of developer demands to use the tools of choice. As Agile has settled in as a mainstream practice, now DevOps has emerged as the next wave to improve software delivery speed and output. To make DevOps work, organization...
Mar. 30, 2017 04:15 AM EDT Reads: 2,435