@Ryan_Stille You could in your logging process, set something for mailserverX, so if you have multiple mail servers and / or multiple ColdFusion servers you can have better diagnostic logs.
As for the configuration, while there is no “right answer” to this, my configuration for the entire platform is stored in a database table. This way when I have an email job, it calls forth the correct mail server(s) based upon what is being sent.
I used to do exactly what you suggest, which is send one email at a time from Lucee / Coldfusion. This works well for small amounts of email and really beefy configurations. This however isn’t practical when it comes to scale.
Anything under 10K emails a day, CFMail from a local server properly configured is fine. Anything over 10K emails or anything that may grow over 10K emails, I suggest creating a dedicated email server and outputing what you need using CFFILE.
As for mailserver configuration, here is what I do.
For small jobs, personal items, ectra, yes I store and throw credentials at specialized sender code for lack of a better word. The code pulls from the database the mail server configuration, which includes passwords and application settings and then sends the message
For larger items, such as bulk mail and transactional emails on a non personal scale, I setup a dedicated vps for the purpose of sending email. Its literally 1000x more efficient in processing terms than anything you will have using java / ColdFusion based email.
I am sure there maybe a better way but this works for what I need
Instead of using CFmail I write the output to a file using cffile. The file is put in a specialized directory that is picked up by a cron job every few seconds and moves files to the correct “mail” server. The “Mail sever” could be anything from the transactional email such as a signup or invoice to a newsletter or internal email for a report, or a sms message. The “Mail” servers all have their own configuration files so security is at the OS and configuration level. This allows us to send 100K emails in the same time it would take us to send 1000 of the same emails.