Mail server for cfmail

As I am changing of mail provider,
The default mail server has been defined in the Lucee administration.
It does work.

But if I use the coding with CFmail parameters (with same parameters),
it does not work, no mail received.
Code is
cfmail to="" from="" subject=“test mail server :” server=“” port=“465” username=""

Mail server TEST


In attached image, there is what is declared in administration.

I tried to add “usessl=true” in the code, with same result. (no mail received)

Any idea, why I have this difference (admin working, code not working with same param)

In future, I want to use the cfmail code to change the mail server.

Thanks for advise,

Linux debian 10
apache 2.4
Java : 1.0.15 (Eclipse Adoptium) 64bit

Look in your /WEB-INF/lucee-web/remote-client/ or /WEB-INF/lucee-server/remote-client/ folders and see if there are any .tsk files, which are created when mail fails to send. If so, open them up with a text editor and see if there are any error messages in there which might tell you what’s wrong.

1 Like

It’s very likely the emails are not passing all the reputation tests and email quality. As @Julian_Halliwell already mentioned, the task files are a first step in identifyimg the issue. But it can also be, that the the provider who is receiving the emails is silently discarding them, wirhout passing them to the final recepient. Check the mail servers SPF and DMARC settings.

In your screenshot is SSL = “Yes” but I don’t see this in your code.

1 Like

I used : “usessl=true” in the CFML code line. With no success (same behaviour)
also, I am not sure that this is a right syntax. (no error from Lucee)

The mail created a tsk file, I read it, but I can’t see any understandable reason for rejection.
Could you help to determine the reason of rejection ?

Thanks, Pierre.
00000001.tsk (6.6 KB)

lucee.runtime.exp.NativeException: timeout occurred after 30 seconds while sending mail message:0
at lucee.runtime.spooler.mail.MailSpoolerTask.execute(
at lucee.runtime.spooler.SpoolerTaskSupport._execute(
at lucee.runtime.spooler.SpoolerEngineImpl.execute(
at lucee.runtime.spooler.SpoolerEngineImpl$
Caused by: timeout occurred after 30 seconds while sending mail message:0

I understand, there is a timeout as no connection is established.

When you created the mailsever connection via the Lucee admin, you can verify it and on the bottom of the page you can see the internal connection string. Did you compare it to your own cfmail script?

You could create the mailservers with this string and use cfmail without any further connection informations.