Smtp problems -

In Lucee Admin when I set it up smtp it says its ok and verifies. But I find this in the logs, any ideas? I’m trying to connect to

"ERROR","Thread-572","07/31/2018","13:58:59","","mail;Could not connect to SMTP host:, port: 587;lucee.runtime.exp.NativeException: Could not connect to SMTP host:, port: 587
	at com.sun.mail.smtp.SMTPTransport.openServer(
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(
	at javax.mail.Service.connect(
Caused by: javax.mail.MessagingException: Could not connect to SMTP host:, port: 587;
  nested exception is: Unrecognized SSL message, plaintext connection?
	... 4 more
Caused by: Unrecognized SSL message, plaintext connection?
	at com.sun.mail.util.SocketFetcher.configureSSLSocket(
	at com.sun.mail.util.SocketFetcher.createSocket(
	at com.sun.mail.util.SocketFetcher.getSocket(
	at com.sun.mail.smtp.SMTPTransport.openServer(
	... 3 more

The error message is pretty clear, you have the wrong port?

Hi Zac,

Thank you for replying. I like that you always reply, it’s really awesome of you.

What was unusual to me was that in the lucee admin it verifies with the port and user name/password. Then it throws when you send it. I could have been more clear in what I was saying… I wonder why it verifies in the admin in the 1st place.

I did figure it out, So if you use 365 what you have to do is create a mail “admin exchange center. mail flow.connectors” and specify your IP in the 365 admin. Also, you are right on with ports. The 365 docs say to use port 587 but that won’t work you have to use port 25. And none of it is documented or makes any sense. Oh, how I love Microsoft 365.


Thanks, I enjoy helping out!

did you use the pre-configured outlook mail server template in the admin?

btw, i think outlook uses TLS not SSL, which may explain the Unrecognized SSL message, plaintext connection?

I too can’t get this to work, no matter what I try. Very, very frustrating. Thanks for all the information though!

Use port 25. No tls or ssl. Make sure you set up flow connectors.

If its still not sending, look at your logs and see what/why microsoft is rejecting and that will give you some insight.

I gave up on Office 365. It simply will not allow us to send email via a Lucee server no matter what combination of solutions we try.

However, I did find that for other SMTP servers, the solution was to create the mail service via the Lucee server administrator, not via individual site context. That made all the difference and those other servers work fine.

Whether or not the issue is Office365’s service, Lucee, or something very particular to our server I don’t know. But for now, I am crying uncle.

I appreciate the advice and help!


When you look a the logs you might find you have to whitelist the IP of your server. I did that, but I don’t know if its necessary, because I found the flow connector after I had did that step ( which I found in the rejection response in the server logs form 365).

Thanks - will have to check it out.