Send email from multiple servers evenly by looping over query
Posted on 2011-05-06
I'm looping over a query to send emails to my users. I have 7 different email servers I want to send from and trying to figure out a way to break up the messages evenly across the servers.
I was previously sending from 2 and using the following:
<cfif emailAlerts.currentrow MOD 2 is 0>
<cfset username = "un"> etc etc
<cfset username = "un22"> etc etc
<cfmail server="#servername#" username="#username#" etc etc>my message</cfmail>
This sends the messages evenly across 2... but how about 7?