Search code examples
emailsmtpgmailodooodoo-10

Odoo 10: Mail Delivery Failed (error: 111)


I am trying to send emails from my Odoo 10 installation. For this I have configured the outgoing mail server with Gmail SMTP as follows:

SMTP Server: smtp.gmail.com
SMTP Port: 465
Priority: 10
Connection Security: SSL/TLS

I have also configured my Gmail account to accept less secure connections from outside and when I run the test from Odoo's email configuration menu I get the following message:

Connection Test Succeeded! Everything seems properly set up!

BUT: If I try to send a real mail with Odoo I get the following error reason:

Mail Delivery Failed
Mail delivery failed via SMTP server 'localhost'.
error: 111
Connection refused

I don't know what to do, I searched for it on the internet but found nothing. Hope somebody can help me. Many thanks in advance.


Solution

  • From the error its clear that Odoo is trying to send emails using "SMTP server 'localhost'".

    By default Odoo will create a localhost server in outgoing mail configuration menu. So you must set the "Priority" field in the form. Set the GMail server priority as "1"and localhost as "2" or any other value.

    Priority: The priority of your mail server. The lower the number the higher the priority. This will mean that the e-mail server with the lowest number will be used the most.