portal entry

select a category, or use search below
(searches all categories and all time range)
Title:

Best method to code bulk emails

| View in Portal
October 16, 2017 10:42:47 PM GMT
1 Comment
Hi. I’m interested to find out if anyone else has written some frequently used code that generates at least 100,000 personalised emails at a time? e.g. a mailing list. Have you done anything in particular to optimise the process such as sharing the work between multiple servers or splitting the task into multiple smaller threads? All of the recipients are in a query and I’m using <cfmail query=”#query#”> to loop through it. There are several cfif/cfelse parts to provide some personalisation based on what’s […]
Labels: Blog, Discussion, cfmail, email, mail

Comments:

Gary, what I have used in the past is this: Write the emails to a spool table (which generally goes pretty fast), then sort by domain and send in batches on a 5-minute interval so as not to clog the network. The spool record included a sent flag and a counter, so it would only try to resend twice. We could then check records that failed and update accounts as applicable. (This was a few years back, using just ColdFusion and a database server.) Sorting by domains would ensure that the SMTP server would not need to make a new connection for each address; only for each domain. One thing my current employer is doing is to offload the email to a messaging queue (they use Apache's ActiveMQ; a former employer used RabbitMQ) so the application could dump the email records to the messaging queue and move on to other tasks, and let the messaging queue do the same functionality as above, sending out messages without affecting the application server performance. The messaging queue can be used with a REST email service, or wired directly into an SMTP server. The only caveat with mail services is that some specialize in transactional email (based on customer request) ONLY. So using them to send bulk email can get you in trouble.
Comment by Jim Bates
1145 | June 25, 2018 02:02:08 PM GMT