Email not sending V5 selfhosted in Plesk

Hi folks.
I have been having some issues with sending emails through V5, I can connect and send through Gmail which is fine… though when using email deliverability tools it gets flagged as spam because of a few reasons.

When connecting to my own mail server self-hosted through Plesk I am running into the same obstacle time and time again.

I have essentially copied my mail credentials into the env file

MAIL_FROM_NAME="Business Name"
MAIL_PASSWORD='something with special characters like ! and & and maybe a ^'

On Plesk my credentials are as follows:
### Manual setup

Mail server username

Incoming mail server

Outgoing mail server
(server requires authentication)

Supported incoming mail protocols
Supported outgoing mail protocols
To connect via POP3 securely over SSL/TLS, use port 995.
To connect via IMAP securely over SSL/TLS, use port 993.
To send messages via SMTP securely, use port 465.

with the following option
Enable SMTP service on port 587 on all IP addresses enabled.

The error I keep getting is
"connection could not be established with host :stream_socket_client(): unable to connect to tcp:// (operation timed out)

Is there something that I am missing here at all?


Are you sure the port is correct, you may want to run telnet 587 to check that it’s reachable.

Hi thanks for your response. Telnet from a remote source says that it can connect ok. Telnet from within the VM that contains Plesk and the container isn’t able to reach.

This then might be a DNS issue locally where it’s not getting resolved correctly?

It could be, you could try using the IP instead of the domain name to check

Ok, yes. doing telnet to the ip address works.
Having changed the env file to the following

and putting " in the password as opposed to ’ is helping me move forward

New error message that comes from that is as follow:
*stream_socket_enable_crypto(): SSL operation failed with code 1. Open SSL Error message error:1416F086:SSL routine:tls_process_server_certificate:certificate verify failed

It looks like there’s a problem with the SSL certificate, sorry I can’t provide more help

No problem. I’m further forward than where I was. I appreciate your help.