Defining and Using Multiple SMTP Servers

The tag CFMAIL supports server, so you could have a condition that chooses
the server.

You could use a smart host or define AAA records and point to a server
cluster for your external mail

Far as I remember you can setup a different connector per instance, though
it seems cleaner from a sys admin stand point, its usually easier from a
programming stand point to just define the mail server in the
Application.cfcOn Thursday, October 22, 2015 at 2:36:54 PM UTC-4, Juan Aguilar wrote:

It’s been a while since I had to define more than one mail server on my
Cold Fusion server. My recollection (from way, way, back) is that, if I
defined the servers in the administrator, I should be able to use
server=“server name” as a cfmail attribute and that mail would go out using
the selected server (and the associated credentials in the administrator).

However, it appears that, if I use the server attribute in the code, I
also have to define a username and password, which would defeat the purpose
of defining the servers in the administrator.

The administrator says:

You can define more than one mail server. When sending an email, Lucee

tries to send the mail with the first defined mail server. If the send
operation fails, Lucee will continue using the next mail server in the list.

Am I mistaken about how to use multiple SMTP servers in Lucee? If I want
to use a specific SMTP server in my code, do I have to define the server,
username, and password, too?

Thanks.