Mailgun

Easy to setup the outgoing and incoming mail flow

The module provides Odoo and Mailgun integration to be able to easily configure Outgoing and Incoming mail flow.
From Mailgun side you get:
  • Powerful Sending Infrastructure
  • Intelligent Inbound Routing & Storage
  • Tracking and Analytics
  • Email Validation

Mailgun Configuration

Manage Domains

  • Create account on Mailgun service
  • Add domain in Domains menu
Note that the state of your domain should be Active to be able to use it from Odoo side. To verify it follow the instruction How do I verify my domain

Click on added domain name and see all the information needed to configure your Incoming and Outgoing mail feature.

If you use sandbox domain, add Authorized Recipient first (sandbox domains are restricted to authorized recipients)


Routes

Navigate to Routes menu and create a new route

Set the following fields and values:

  • Expression Type: Custom
  • Raw Expression: match_recipient('.*@your_mail_domain')
  • Actions:
    • Check the box Store and notify
    • Put there http://your_odoo_domain/mailgun/notify

Now everything is ready to move to Odoo configuration.

Odoo Configuration

Outgoing Mail Feature

At first, activate the developer mode. Then go to Settings → Technical → Email → Outgoing Mail Servers menu and populate the following fields:

  • Description - e.g. Mailgun
  • SMTP Server - smtp.mailgun.org
  • Connection Security - SSL/TLS
  • Username - use Default SMTP Login from mailgun
  • Password - use Default Password from mailgun
Once the fields are populated, click Test Connection button to check the connection to smtp server. If everything is ok, you can see popup message Connection Test Succeeded! Everything seems properly set up! and you are able to send messages now.

Incoming Mail Feature

Note that to setup incoming mailing, it is not required to setup Incoming Mail Server.
Open Settings → General Settings menu:

  • Check the box External Email Servers
  • Set as Alias Domain the domain name from Mailgun
Save the changes.

Setup mailgun API credentials in Settings → Parameters → System Parameters menu. Create new parameter:

  • Key - mailgun.apikey
  • Value - key-12345...

Now you can configure mail aliases for users. Go to Settings → Users menu and open user form (e.g. for Administrator). Then switch to Preferences tab and select an existing alias or create new one in the Alias field.

Open the user's related partner and set Email - the email is used for replying on user messages

Everything is done! It's time to send/receive email messages now!

Tested on Odoo
11.0 community
Tested on Odoo
11.0 enterprise