Getting Mailer to work with Use SSL option

when my mailer.json is like this i have no issue sending email
{
“name”: “main”,
“module”: “mail”,
“action”: “setup”,
“options”: {
“host”: “smtp.office365.com”,
“port”: 587,
“username”: “it@",
“password”: "

}
}
But if tick ‘Use SSL’ then following error;

server-connect:server Got error? [Error: 139988254070720:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:…/deps/openssl/openssl/ssl/record/ssl3_record.c:332:
server-connect:server ] {
server-connect:server library: ‘SSL routines’,
server-connect:server function: ‘ssl3_get_record’,
server-connect:server reason: ‘wrong version number’,
server-connect:server code: ‘ESOCKET’,
server-connect:server command: ‘CONN’
server-connect:server } +0ms

i have been at this for sometime and not able to resolve the issue. On the linux server i have OpenSSL 3.0.2 15 Mar 2022.
What is missing? Help much appreciated…

I believe the outgoing smtp server for office365 uses STARTTLS instead of SSL/TLS. I don’t think Wappler supports that protocol? I may be wrong but I believe I had an issue similar to this before. Would probably be a @patrick question?

For port 587 you should not use SSL, it uses STARTTLS for a secure connection. Normally port 465 is for SSL connections.

The mailer module uses the Nodemailer package, you could check their documentation for specific settings.

https://nodemailer.com/smtp/

i dug into nodemailer. it seems it is not simple to go SSL. And realized without SSL nodemailer negotiates and fall back to best option that works for two ends. so i too settled for that.

Hi Everyone,

Reading through all these posts and still can’t get my Mailer to work.

image

Very new at this and looking for any advice! Thanks!

Varies from server to server but I find use Ssl on and port 465 works for me.

Sorry just noticed its office 365 so I believe should normally be:
Port 587 SSL on
or
Port 25 no SSL

Try to debug to diagnose the problem and share details if you need help resolving it.

Thanks Brian @Hyperbytes. I still couldn’t get it to work.

I decided to use the SendGrid SMTP. The setup was quick and works!

I have no problem using office365 for smtp. These are my settings.

image

The challenge with using Microsoft is that by default 2FA is enabled for all accounts. You have to disable it and also ensure the User has “Authenticated SMTP” enabled.

1 Like