Lucee version: 184.108.40.206 (not available to choose above).
Scenario: A mail server is registered in the Server admin (or Web admin). A different mail server is defined in my Application.cfc using this.mailservers
Expected behaviour: if I call cfmail in my application without specifying a server, the mail server defined in Application.cfc should be used.
Actual behaviour: calling cfmail without specifying a server results in the mail server registered in the admin to be used - i.e. it incorrectly overrides the Application.cfc mail server setting.
Steps to reproduce:
1. Set up 2 mail servers one listening on port 25 the other on port 587 (I use smtp4dev which allows multiple instances)
2. Add the port 25 server to the Lucee admin
3. Create an Application.cfc with the port 587 server defined as follows:
Create a template in the application with the following code:
4. Execute the template and note which server receives the email (for me it is the port 25 server defined in the Admin)
5. Now delete the port 25 server in the admin
6. Execute the template again and note which server receives the email (for me it is the port 587 server defined in the Application.cfc)
Either admin. Tested in both, same result.
Have added a screenshot of my 2 dev mail server instances. The one on port 587 should have received both test emails.
Yes. And the app defined config works fine if I remove the admin registered server.
Yes, I replicated the issue as per the reporter said. Actually, if we set a mail server in admin, lucee considered this as first preference. will confirm this.
application.cfc should always come first