MailService doesn't use the mail server defined in the Railo Admin

I'm trying to use the EmailService plugin for the first time and ran
into an issue where sending an email fails (silently) when I don't do
a setServer operation on my mail object. When I do a normal <cfmail>
operation, it sends out email fine, I don't bother to set a server or
anything it just picks it up from the admin setting, but with the
EmailService CB plugin, it fails.

Looking through the CB code, I have a guess as to why (though I
haven't had a chance to prove it yet). When CB actually sends out the
email in the MailService.cfc (nice whitespace rant in the comments,
btw, Luis) it is just sending an attributeCollection to cfmail. Since
the attribute for the server name defaults to an empty string in the
mail settings bean, I'm guessing that it is passing in "" as the
server name to cfmail.

That leads me to a question, which is this: is this a Railo bug or a
ColdBox bug? If you pass in Server="" to cfmail in ACF, does it fall
back and use the setting in the Administrator? If so, that's a Railo
compatibility bug that I should file. If it does not send the email,
should we do something like remove the key from the memento before
passing it into the attributeCollection in the case of it being blank
so that the CF engine will fall back to the Administrator setting?

I'm running Railo 3.2RC and CB 3.0.0 M5 by the by.


Judah, thanks for the nice explanation. If you have a server="" in ACF, it falls back to the definied one on the administrator.

What can we do to prevent this? Remove it?

Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
IECFUG Manager:

I'll try and come up with a base demo case and submit it as a
compatibility bug to Railo. For now, I can define my mail server in
the Coldbox config and get the setting from there.


I've entered this bug in Railo and will try and remember to update
this discussion once it is resolved: