Configure outgoing mailservers

Hi there!

In this tutorial I will explain you how to configure an outgoing mail server with Gmail.
Configuring outgoing mail servers in Odoo is one of the most simple things there are, you just need to know what exactly you should fill in.

First go to Settings > Email > Outgoing Mail servers and click on Create.
You will get a new window looking like this:
Sample empty email server
Let’s go over the fields:

  • Description: A description for the outgoing mail server.
  • Priority: The priority of your mail server. The lower the number the higher the priority. This will mean that the e-mailserver with the lowest number will be used the most.
  • SMTP server: The pointer to the SMTP of your server, for example smtp.gmail.com.
  • SMTP port: The port of your SMTP server, for example port 465 for Gmail.
  • Connection security: The type of security. You should choose SSL/TLS for Gmail. The data is then send over HTTPS.
  • Username: Your e-mail account, in this example youremail@gmail.com
  • Password: The password of your e-mail account.

For Gmail it will look like this:
Configured outgoing mailserver

Now save the record and from now on Odoo will send all your e-mails from Odoo to the person you want to e-mail.
TIP: by default the time that Odoo sends e-mails from Odoo is every 1 hour. If you wish to modify this you should go to Settings > Automation > Scheduled Actions and open up the record ‘Email Queue Manager’. Modify the time to your likings.. For example every 2 minutes:
Send mail every 2 minutes

For more information check out this Wikipedia article about mailservers.

Tutorial sponsored by Oocademy




17 thoughts on “Configure outgoing mailservers

  1. BINHNC says:

    Hi YenThe666
    I appreciated your guiding. I set up my outgoing mail server following you list of steps above then getting issue when click on Test connection button.

    “Connection Test Failed!

    Here is what we got instead:
    534
    5.7.14 Please log in via your web browser and
    5.7.14 then try again.
    5.7.14 Learn more at
    5.7.14 https://support.google.com/mail/answer/78754 ym6sm18162145pac.32 – gsmtp

    I’m building website using odoo in Local.
    Please help me to detect and fix it.

    Thank you so much

    • Yenthe666 says:

      Hi BINHNC,

      No problem! The problem is that your Gmail account doesn’t allow ‘unsecure’ connections and Odoo falls under them. Follow that URL and allow unsafe connections, then it will work.

      • gemchand says:

        I followed your guiding. I set up my outgoing mail server and I saw following error.

        “Connection Test Failed!

        Here is what we got instead:
        534
        5.7.14 Please log in via your web browser and
        5.7.14 then try again.
        5.7.14 Learn more at
        5.7.14 https://support.google.com/mail/answer/78754 ym6sm18162145pac.32 – gsmtp

        Please help me to solve the problem

        Thank You

        • Yenthe666 says:

          Hi gemchand,

          This means your Gmail doesn’t allow unsafe connections. You can fix this by following that link and activating the checkbox to allow unsafe connections.

  2. reham says:

    hi
    i set up the configure to incoming and outgoing email server, but I have problem with sending emails(Mail Delivery Failed) and i can’t fetch the mail automatically

  3. Manvir says:

    I am trying to send email to users using this

    template_pool.browse(template_id.id).send_mail(user.id, force_send=True)

    But this causes user to receive more than one mail (some mails remain in queue and are delivered after execution of email queue manager). How can I prevent sending of redundant mails?
    — Thank You

    • Yenthe666 says:

      Hi Manvir,

      When an e-mail is sent multiple times it means your action (or whatever you trigger to let this line of code go off) is triggered multiple times. Have another look at your code, this code should be triggered multiple times if it e-mails multiple times.

  4. Hi!

    I’d like to ask something since i’m not gasping the concept correctly i think.

    1. Each user on odoo has to configure their account to send email?

    2. Or do you configure 1 email server settings and all emails go out with that configuration?

    With the #1, then odoo works as a email client like Evolution. Thunderbird or Outlook, right?

    On the #2, you need to install an email server on the odoo machine?

    So far i think is the first one, am i right?

    • Yenthe666 says:

      Hi Luis,

      By default you have one outgoing e-mailserver, which you can configure to send out e-mails from a specific name (there are several topics about this on the web).
      There is also a module made by somebody to configure multiple incoming / outgoing mailservers which gives you the option to configure a mailserver per user. See https://www.odoo.com/apps/modules/8.0/smtp_per_user/

  5. deep says:

    I have configured using my corporate Server, which works perfectly well.
    However there seems to be delay between the Emails exchanged between the Outlook mail

    Say my official server is smtp.xxx_domain.com.
    Now lets say I have sent mail to 2 Users, same time, one having gmail address, while other having address of same domain, say user@xxx_domain.com

    Now, Mail received in Gmail is almost immediate, however the same mail been received in Outlook/Webmail takes quiet a long time.
    Any idea what could be the reason.

    • Yenthe666 says:

      Hi Deep,

      There looks to be a delay on Outlook e-mails, probably by the way it is handled in Exchange. I have the same ‘issue’ on my Odoo instances but the delay is not big enough to call it a real issue I guess. 🙂

  6. Anatha Moorthy says:

    Dear Yenthe,

    You are doing a great job, nice blog.

    I am trying to set up outgoing mail server in version 10 and 11(odoo installed on cloud), I am not able to test connection, when I click on Test Connection, Page is continuously loading without any output, whereas same thing if I do in my local system with same credentials, it’s working for me. Am I missing some configuration?

    • Yenthe666 says:

      Hi Anatha,

      Thanks for the positive feedback! Have a look in the logfile, it should give you a good idea of what is wrong here. There has to be some difference.

  7. Stefan says:

    hi Yenthe,
    I have challenges configuring the g-suite servers to work with Odoo 11 community version.
    I followed all guidance from the Odoo 11 and I have configured the smtp-relay service for the g-mail app in the g-suite.
    However the errors are still poping up and I am not sure what could cause them. Any ideas and any guidance?
    Thanks in adnance!

Leave a Reply

Your email address will not be published. Required fields are marked *