SMPT "Connection Refused" Debian 9

Checklist
[x] I have read intro post: About the Installation Issues category
[x] I have read the tutorials, help and searched for similar issues
[x] I provide relevant information about my server (component names and versions, etc.)
[x] I provide a copy of my logs and healthcheck
[x] I describe the steps I have taken to trouble shoot the problem
[x] I describe the steps on how to reproduce the issue

Hi I’m having issues with sending email invitations to new users.
The issue is as follows :
I use the ./cake EmailQueue.sender and i get this error : “Connection refused” && “Error 103 was not send”.

I’ve tried doing as I’ve seen in other posts ( cleaning cache, deleting /vendor, and doing compose install) and the issue remains.
I have my EmailTransport as follows :

// Email configuration.
    'EmailTransport' => [
        'default' => [
            'host' => '127.0.0.1',
            'port' => 587,
            'username' => '********', // hidden for security reasons
            'password' => '**********', // hidden for security reasons
            // Is this a secure connection? true if yes, null if no.
            'tls' => true,
            //'timeout' => 30,
            //'client' => null,
            //'url' => null,
        ],
    ],

My port 587 is open and ssl set correctly. Can anybody give me a hand?

These settings indicate your mail server is local. To confirm, you have a mail server setup already locally? If so, you wouldn’t need credentials but can just send it from the server.

The credentials are typically needed when you are connecting to a remote mail server.

Okay that might be the problem here, no, I don’t have any mail server in my machine. In my company we have our mails hosted by gmail. I wanted to configure at the smtp installation step but I didn’t know how to do it.
I must have a local smtp server or can I use gmail for doing it? If so, how do I configure to use our gmail account ?

To use the Gmail server, change host to ‘smtp.gmail.com’. Try that, and it should attempt to log in with your provided credentials.

I should add that if you opened port 587 just for this feature, you should close it as it is not needed to be opened for only outgoing mail.

Okay I changed to smpt.gmail.com, and that error is fixed. But now i get a password error. I only have to use my email and password for google right?

Ok everything done, I had to activate the “allow less secure apps” thing in the account.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.