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="pierre@pl-arts.com" from="admin@leol.fr" subject=“test mail server : admin@leol.fr” server=“mail65.lwspanel.com” port=“465” username="admin@leol.fr"
password=“xxxxxxxxxxxxxx”

Mail server TEST

/cfmail

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,
Pierre.

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

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: mail65.lwspanel.com timeout occurred after 30 seconds while sending mail message:0
at lucee.runtime.net.smtp.SMTPClient._send(SMTPClient.java:912)
at lucee.runtime.spooler.mail.MailSpoolerTask.execute(MailSpoolerTask.java:139)
at lucee.runtime.spooler.SpoolerTaskSupport._execute(SpoolerTaskSupport.java:107)
at lucee.runtime.spooler.SpoolerEngineImpl.execute(SpoolerEngineImpl.java:595)
at lucee.runtime.spooler.SpoolerEngineImpl$TaskThread.run(SpoolerEngineImpl.java:533)
Caused by: lucee.runtime.net.mail.MailException: mail65.lwspanel.com 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.