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:
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:
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:
For more information check out this Wikipedia article about mailservers.
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
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.
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
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.
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
Hi Reham,
I’m sorry but this doesn’t tell where the problem is coming from and/or what might be wrong. Post an issue on the official help forum with more info! (https://www.odoo.com/forum/help-1)
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
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.
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?
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/
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.
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. 🙂
Good Tutuorial.
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?
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.
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!
Hi Stefan,
Not directly, you can have quite some issues with relaying and mail servers so there are many options. Why don’t you ask it on the official help forums (https://www.odoo.com/forum/help-1) with details about what you’ve done?