|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
SYS-CON Events announced today that Catchpoint, a leading digital experience intelligence company, has been named “Silver 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. Catchpoint Systems is a leading Digital Performance Analytics company that provides unparalleled insight into your customer-critical services to help you consistently deliver an amazing customer experience. Designed for digital business, C...
Jan. 21, 2017 11:45 AM EST Reads: 1,844
More and more brands have jumped on the IoT bandwagon. We have an excess of wearables – activity trackers, smartwatches, smart glasses and sneakers, and more that track seemingly endless datapoints. However, most consumers have no idea what “IoT” means. Creating more wearables that track data shouldn't be the aim of brands; delivering meaningful, tangible relevance to their users should be. We're in a period in which the IoT pendulum is still swinging. Initially, it swung toward "smart for smart...
Jan. 21, 2017 11:30 AM EST Reads: 2,803
WebRTC sits at the intersection between VoIP and the Web. As such, it poses some interesting challenges for those developing services on top of it, but also for those who need to test and monitor these services. In his session at WebRTC Summit, Tsahi Levent-Levi, co-founder of testRTC, reviewed the various challenges posed by WebRTC when it comes to testing and monitoring and on ways to overcome them.
Jan. 21, 2017 11:15 AM EST Reads: 6,117
The emerging Internet of Everything creates tremendous new opportunities for customer engagement and business model innovation. However, enterprises must overcome a number of critical challenges to bring these new solutions to market. In his session at @ThingsExpo, Michael Martin, CTO/CIO at nfrastructure, outlined these key challenges and recommended approaches for overcoming them to achieve speed and agility in the design, development and implementation of Internet of Everything solutions with...
Jan. 21, 2017 10:00 AM EST Reads: 5,663
Every successful software product evolves from an idea to an enterprise system. Notably, the same way is passed by the product owner's company. In his session at 20th Cloud Expo, Oleg Lola, CEO of MobiDev, will provide a generalized overview of the evolution of a software product, the product owner, the needs that arise at various stages of this process, and the value brought by a software development partner to the product owner as a response to these needs.
Jan. 21, 2017 07:30 AM EST Reads: 1,306
In 2014, Amazon announced a new form of compute called Lambda. We didn't know it at the time, but this represented a fundamental shift in what we expect from cloud computing. Now, all of the major cloud computing vendors want to take part in this disruptive technology. In his session at 20th Cloud Expo, John Jelinek IV, a web developer at Linux Academy, will discuss why major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform are all trying to sidestep VMs and containers...
Jan. 21, 2017 07:15 AM EST Reads: 939
SYS-CON Events announced today that MobiDev, a client-oriented software development company, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place 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. MobiDev is a software company that develops and delivers turn-key mobile apps, websites, web services, and complex softw...
Jan. 21, 2017 06:45 AM EST Reads: 1,954
Smart Cities are here to stay, but for their promise to be delivered, the data they produce must not be put in new siloes. In his session at @ThingsExpo, Mathias Herberts, Co-founder and CTO of Cityzen Data, discussed the best practices that will ensure a successful smart city journey.
Jan. 21, 2017 06:00 AM EST Reads: 2,097
Technology vendors and analysts are eager to paint a rosy picture of how wonderful IoT is and why your deployment will be great with the use of their products and services. While it is easy to showcase successful IoT solutions, identifying IoT systems that missed the mark or failed can often provide more in the way of key lessons learned. In his session at @ThingsExpo, Peter Vanderminden, Principal Industry Analyst for IoT & Digital Supply Chain to Flatiron Strategies, will focus on how IoT depl...
Jan. 21, 2017 03:45 AM EST Reads: 1,992
Big Data, cloud, analytics, contextual information, wearable tech, sensors, mobility, and WebRTC: together, these advances have created a perfect storm of technologies that are disrupting and transforming classic communications models and ecosystems. In his session at @ThingsExpo, Erik Perotti, Senior Manager of New Ventures on Plantronics’ Innovation team, provided an overview of this technological shift, including associated business and consumer communications impacts, and opportunities it m...
Jan. 21, 2017 02:00 AM EST Reads: 5,829
Manufacturers are embracing the Industrial Internet the same way consumers are leveraging Fitbits – to improve overall health and wellness. Both can provide consistent measurement, visibility, and suggest performance improvements customized to help reach goals. Fitbit users can view real-time data and make adjustments to increase their activity. In his session at @ThingsExpo, Mark Bernardo Professional Services Leader, Americas, at GE Digital, discussed how leveraging the Industrial Internet and...
Jan. 21, 2017 01:30 AM EST Reads: 6,573
"Tintri was started in 2008 with the express purpose of building a storage appliance that is ideal for virtualized environments. We support a lot of different hypervisor platforms from VMware to OpenStack to Hyper-V," explained Dan Florea, Director of Product Management at Tintri, in this SYS-CON.tv interview at 18th Cloud Expo, held June 7-9, 2016, at the Javits Center in New York City, NY.
Jan. 21, 2017 01:15 AM EST Reads: 4,923
There will be new vendors providing applications, middleware, and connected devices to support the thriving IoT ecosystem. This essentially means that electronic device manufacturers will also be in the software business. Many will be new to building embedded software or robust software. This creates an increased importance on software quality, particularly within the Industrial Internet of Things where business-critical applications are becoming dependent on products controlled by software. Qua...
Jan. 21, 2017 01:15 AM EST Reads: 5,065
Fact is, enterprises have significant legacy voice infrastructure that’s costly to replace with pure IP solutions. How can we bring this analog infrastructure into our shiny new cloud applications? There are proven methods to bind both legacy voice applications and traditional PSTN audio into cloud-based applications and services at a carrier scale. Some of the most successful implementations leverage WebRTC, WebSockets, SIP and other open source technologies. In his session at @ThingsExpo, Da...
Jan. 21, 2017 01:15 AM EST Reads: 2,894
A critical component of any IoT project is what to do with all the data being generated. This data needs to be captured, processed, structured, and stored in a way to facilitate different kinds of queries. Traditional data warehouse and analytical systems are mature technologies that can be used to handle certain kinds of queries, but they are not always well suited to many problems, particularly when there is a need for real-time insights.
Jan. 21, 2017 12:15 AM EST Reads: 6,383
In his General Session at 16th Cloud Expo, David Shacochis, host of The Hybrid IT Files podcast and Vice President at CenturyLink, investigated three key trends of the “gigabit economy" though the story of a Fortune 500 communications company in transformation. Narrating how multi-modal hybrid IT, service automation, and agile delivery all intersect, he will cover the role of storytelling and empathy in achieving strategic alignment between the enterprise and its information technology.
Jan. 21, 2017 12:00 AM EST Reads: 4,723
IoT is at the core or many Digital Transformation initiatives with the goal of re-inventing a company's business model. We all agree that collecting relevant IoT data will result in massive amounts of data needing to be stored. However, with the rapid development of IoT devices and ongoing business model transformation, we are not able to predict the volume and growth of IoT data. And with the lack of IoT history, traditional methods of IT and infrastructure planning based on the past do not app...
Jan. 20, 2017 10:45 PM EST Reads: 941
WebRTC is bringing significant change to the communications landscape that will bridge the worlds of web and telephony, making the Internet the new standard for communications. Cloud9 took the road less traveled and used WebRTC to create a downloadable enterprise-grade communications platform that is changing the communication dynamic in the financial sector. In his session at @ThingsExpo, Leo Papadopoulos, CTO of Cloud9, discussed the importance of WebRTC and how it enables companies to focus o...
Jan. 20, 2017 08:45 PM EST Reads: 4,406
The Internet of Things can drive efficiency for airlines and airports. In their session at @ThingsExpo, Shyam Varan Nath, Principal Architect with GE, and Sudip Majumder, senior director of development at Oracle, discussed the technical details of the connected airline baggage and related social media solutions. These IoT applications will enhance travelers' journey experience and drive efficiency for the airlines and the airports.
Jan. 20, 2017 05:45 PM EST Reads: 2,113
With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo 2016 in New York. Learn what is going on, contribute to the discussions, and ensure that your enterprise is as "IoT-Ready" as it can be! Internet of @ThingsExpo, taking place June 6-8, 2017, at the Javits Center in New York City, New York, is co-located with 20th Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry p...
Jan. 20, 2017 05:15 PM EST Reads: 3,837