|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
Join IBM June 8 at 18th Cloud Expo at the Javits Center in New York City, NY, and learn how to innovate like a startup and scale for the enterprise. You need to deliver quality applications faster and cheaper, attract and retain customers with an engaging experience across devices, and seamlessly integrate your enterprise systems. And you can't take 12 months to do it.
Apr. 29, 2016 04:30 PM EDT Reads: 1,749
Machine Learning helps make complex systems more efficient. By applying advanced Machine Learning techniques such as Cognitive Fingerprinting, wind project operators can utilize these tools to learn from collected data, detect regular patterns, and optimize their own operations. In his session at 18th Cloud Expo, Stuart Gillen, Director of Business Development at SparkCognition, will discuss how research has demonstrated the value of Machine Learning in delivering next generation analytics to im...
Apr. 29, 2016 03:45 PM EDT Reads: 1,587
This is not a small hotel event. It is also not a big vendor party where politicians and entertainers are more important than real content. This is Cloud Expo, the world's longest-running conference and exhibition focused on Cloud Computing and all that it entails. If you want serious presentations and valuable insight about Cloud Computing for three straight days, then register now for Cloud Expo.
Apr. 29, 2016 03:30 PM EDT Reads: 1,646
You think you know what’s in your data. But do you? Most organizations are now aware of the business intelligence represented by their data. Data science stands to take this to a level you never thought of – literally. The techniques of data science, when used with the capabilities of Big Data technologies, can make connections you had not yet imagined, helping you discover new insights and ask new questions of your data. In his session at @ThingsExpo, Sarbjit Sarkaria, data science team lead ...
Apr. 29, 2016 03:07 PM EDT Reads: 190
So, you bought into the current machine learning craze and went on to collect millions/billions of records from this promising new data source. Now, what do you do with them? Too often, the abundance of data quickly turns into an abundance of problems. How do you extract that "magic essence" from your data without falling into the common pitfalls? In her session at @ThingsExpo, Natalia Ponomareva, Software Engineer at Google, will provide tips on how to be successful in large scale machine lear...
Apr. 29, 2016 02:45 PM EDT Reads: 800
IoT device adoption is growing at staggering rates, and with it comes opportunity for developers to meet consumer demand for an ever more connected world. Wireless communication is the key part of the encompassing components of any IoT device. Wireless connectivity enhances the device utility at the expense of ease of use and deployment challenges. Since connectivity is fundamental for IoT device development, engineers must understand how to overcome the hurdles inherent in incorporating multipl...
Apr. 29, 2016 02:30 PM EDT Reads: 1,395
The paradigm has shifted. A Gartner survey shows that 43% of organizations are using or plan to implement the Internet of Things in 2016. However, not just a handful of companies are still using the old-style ad-hoc trial-and-error ways, unaware of the critical barriers, paint points, traps, and hidden roadblocks. How can you become a winner? In his session at @ThingsExpo, Tony Shan will present a methodical approach to guide the holistic adoption and enablement of IoT implementations. This ov...
Apr. 29, 2016 02:00 PM EDT Reads: 1,530
We’ve worked with dozens of early adopters across numerous industries and will debunk common misperceptions, which starts with understanding that many of the connected products we’ll use over the next 5 years are already products, they’re just not yet connected. With an IoT product, time-in-market provides much more essential feedback than ever before. Innovation comes from what you do with the data that the connected product provides in order to enhance the customer experience and optimize busi...
Apr. 29, 2016 02:00 PM EDT Reads: 822
The IETF draft standard for M2M certificates is a security solution specifically designed for the demanding needs of IoT/M2M applications. In his session at @ThingsExpo, Brian Romansky, VP of Strategic Technology at TrustPoint Innovation, will explain how M2M certificates can efficiently enable confidentiality, integrity, and authenticity on highly constrained devices.
Apr. 29, 2016 02:00 PM EDT Reads: 969
Artificial Intelligence has the potential to massively disrupt IoT. In his session at 18th Cloud Expo, AJ Abdallat, CEO of Beyond AI, will discuss what the five main drivers are in Artificial Intelligence that could shape the future of the Internet of Things. AJ Abdallat is CEO of Beyond AI. He has over 20 years of management experience in the fields of artificial intelligence, sensors, instruments, devices and software for telecommunications, life sciences, environmental monitoring, process...
Apr. 29, 2016 01:30 PM EDT Reads: 771
SYS-CON Events announced today that Ericsson has been named “Gold Sponsor” of SYS-CON's @ThingsExpo, which will take place on June 7-9, 2016, at the Javits Center in New York, New York. Ericsson is a world leader in the rapidly changing environment of communications technology – providing equipment, software and services to enable transformation through mobility. Some 40 percent of global mobile traffic runs through networks we have supplied. More than 1 billion subscribers around the world re...
Apr. 29, 2016 01:00 PM EDT Reads: 742
SYS-CON Events announced today that Stratoscale, the software company developing the next generation data center operating system, will exhibit at SYS-CON's 18th International Cloud Expo®, which will take place on June 7-9, 2016, at the Javits Center in New York City, NY. Stratoscale is revolutionizing the data center with a zero-to-cloud-in-minutes solution. With Stratoscale’s hardware-agnostic, Software Defined Data Center (SDDC) solution to store everything, run anything and scale everywhere...
Apr. 29, 2016 01:00 PM EDT Reads: 1,476
Angular 2 is a complete re-write of the popular framework AngularJS. Programming in Angular 2 is greatly simplified – now it's a component-based well-performing framework. This immersive one-day workshop at 18th Cloud Expo, led by Yakov Fain, a Java Champion and a co-founder of the IT consultancy Farata Systems and the product company SuranceBay, will provide you with everything you wanted to know about Angular 2.
Apr. 29, 2016 12:30 PM EDT Reads: 1,627
SYS-CON Events announced today that Men & Mice, the leading global provider of DNS, DHCP and IP address management overlay solutions, will exhibit at SYS-CON's 18th International Cloud Expo®, which will take place on June 7-9, 2016, at the Javits Center in New York City, NY. The Men & Mice Suite overlay solution is already known for its powerful application in heterogeneous operating environments, enabling enterprises to scale without fuss. Building on a solid range of diverse platform support,...
Apr. 29, 2016 11:45 AM EDT Reads: 2,216
In his session at @ThingsExpo, Chris Klein, CEO and Co-founder of Rachio, will discuss next generation communities that are using IoT to create more sustainable, intelligent communities. One example is Sterling Ranch, a 10,000 home development that – with the help of Siemens – will integrate IoT technology into the community to provide residents with energy and water savings as well as intelligent security. Everything from stop lights to sprinkler systems to building infrastructures will run ef...
Apr. 29, 2016 11:30 AM EDT Reads: 475
You deployed your app with the Bluemix PaaS and it's gaining some serious traction, so it's time to make some tweaks. Did you design your application in a way that it can scale in the cloud? Were you even thinking about the cloud when you built the app? If not, chances are your app is going to break. Check out this webcast to learn various techniques for designing applications that will scale successfully in Bluemix, for the confidence you need to take your apps to the next level and beyond.
Apr. 29, 2016 11:15 AM EDT Reads: 1,412
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, will discuss how leveraging the Industrial Interne...
Apr. 29, 2016 10:00 AM EDT Reads: 1,106
Whether your IoT service is connecting cars, homes, appliances, wearable, cameras or other devices, one question hangs in the balance – how do you actually make money from this service? The ability to turn your IoT service into profit requires the ability to create a monetization strategy that is flexible, scalable and working for you in real-time. It must be a transparent, smoothly implemented strategy that all stakeholders – from customers to the board – will be able to understand and comprehe...
Apr. 29, 2016 09:30 AM EDT Reads: 989
Increasing IoT connectivity is forcing enterprises to find elegant solutions to organize and visualize all incoming data from these connected devices with re-configurable dashboard widgets to effectively allow rapid decision-making for everything from immediate actions in tactical situations to strategic analysis and reporting. In his session at 18th Cloud Expo, Shikhir Singh, Senior Developer Relations Manager at Sencha, will discuss how to create HTML5 dashboards that interact with IoT devic...
Apr. 29, 2016 09:00 AM EDT Reads: 831
The increasing popularity of the Internet of Things necessitates that our physical and cognitive relationship with wearable technology will change rapidly in the near future. This advent means logging has become a thing of the past. Before, it was on us to track our own data, but now that data is automatically available. What does this mean for mHealth and the "connected" body? In her session at @ThingsExpo, Lisa Calkins, CEO and co-founder of Amadeus Consulting, will discuss the impact of wea...
Apr. 29, 2016 08:45 AM EDT Reads: 600