We use coldfusion 9, and have sending limits with our individual SMTP accounts that our site uses to send email. I want to alternate between two servers depending on what time of day it is.
<cfif timeformat(now(),'HH:mm:ss') GT '12:00:00' >
<cfset email.username="[email protected]" />
<cfset email.password="s3cr3t" />
<cfelse>
<cfset email.username="[email protected]" />
<cfset email.password="s3cr3t2" />
</cfif>
I would like to do this in Application.cfm
(we don't use cfc) and not have to modify any cfmail
tags...
If you want to split the volume of email between each server, I would suggest keeping a value that would tell you which server to use next:
This would go in your appplication file.
Whenever a cfmail is used, it would use the current settings: