Skip to content

Email in Odoo

How Email Works in Odoo

Odoo can both send and receive emails. Outgoing emails deliver invoices, quotes, and notifications. Incoming emails can create leads, tickets, or update existing records. Email is deeply integrated with the Chatter system for seamless communication tracking.

Email Flow Overview

Outgoing Emails

mermaid
graph LR
    U[User clicks Send] --> O[Odoo creates email]
    O --> Q[Mail Queue]
    Q --> S[Outgoing Server SMTP]
    S --> R[Recipient's Inbox]

Incoming Emails

mermaid
graph LR
    C[Customer sends email] --> I[Incoming Server IMAP/POP]
    I --> O[Odoo fetches email]
    O --> P[Odoo processes]
    P --> R[Creates/Updates record]

Email Configuration

Outgoing Mail Server (SMTP)

SettingDescriptionExample
SMTP ServerMail server addresssmtp.gmail.com
SMTP PortServer port587 (TLS) or 465 (SSL)
Connection SecurityEncryption typeTLS (Recommended)
UsernameSMTP accountnoreply@company.com
PasswordSMTP passwordApp-specific password

Location: Settings → Technical → Email → Outgoing Mail Servers

Gmail/Google Workspace

For Gmail, use an App Password instead of your regular password:

  1. Enable 2-Factor Authentication on Google account
  2. Go to Security → App Passwords
  3. Generate password for "Mail" on "Other"
  4. Use this 16-character password in Odoo

Incoming Mail Server (IMAP/POP)

SettingDescriptionExample
Server TypeIMAP (recommended) or POPIMAP
Server NameMail server addressimap.gmail.com
PortServer port993 (SSL)
UsernameEmail accountsales@company.com
PasswordAccount passwordApp-specific password

Location: Settings → Technical → Email → Incoming Mail Servers

Common Email Features

FeatureWhat It DoesExample
Email TemplatesPre-written emails with dynamic placeholdersInvoice reminder that auto-fills customer name and amount
Email AliasAuto-create records from emails to specific addressessales@company.com creates new CRM leads
Mail GatewayRoute incoming emails to correct recordsReply to invoice email updates that invoice's chatter
Scheduled EmailsQueue emails to send laterSend newsletter at 9 AM tomorrow
Mass MailingSend to many recipientsMarketing campaigns
Email TrackingTrack opens and clicksKnow when customer reads email

Email Aliases

Aliases automatically create records when emails arrive at specific addresses.

How Aliases Work

mermaid
graph LR
    E["Email arrives at
    sales@company.com"] --> A[Alias matched]
    A --> M[Model: crm.lead]
    M --> R[New Lead created]
    R --> C[Email attached to Chatter]

Common Aliases

AliasCreatesModule
sales@yourcompany.comCRM LeadCRM
support@yourcompany.comHelpdesk TicketHelpdesk
jobs@yourcompany.comHR ApplicationRecruitment
info@yourcompany.comLead or MessageCRM
purchase@yourcompany.comRFQ/Vendor BillPurchase

Setting Up Aliases

  1. Go to the module settings (e.g., CRM → Configuration)
  2. Find the Alias section
  3. Set the alias prefix (e.g., "sales")
  4. Configure the domain in Settings → Technical → Parameters

Catchall Alias

The catchall alias (configured in Settings → Technical → Alias Domain) routes replies to existing records. When someone replies to an Odoo email, the catchall matches it to the original record.

Email Templates

Templates save time by pre-filling common emails with dynamic data.

Template Structure

ComponentPurposeExample
SubjectEmail subject line"Invoice {{ object.name }} - {{ object.partner_id.name }}"
BodyEmail contentDynamic HTML with placeholders
FromSender addressCan be fixed or dynamic
Reply-ToWhere replies goUsually catchall or specific
AttachmentsFiles to includeReports, documents

Dynamic Placeholders (Jinja2/QWeb)

Templates use placeholders that get replaced with real data:

PlaceholderResolves ToExample Result
{{ object.partner_id.name }}Customer's name"Acme Corp"
{{ object.amount_total }}Invoice total"$1,500.00"
{{ object.date_order }}Order date"2024-12-15"
{{ object.user_id.name }}Assigned salesperson"Sarah Johnson"
{{ object.company_id.name }}Company name"My Company"
{{ object.name }}Record reference"SO/2024/001"

Location: Settings → Technical → Email → Email Templates

Creating a Template

  1. Go to Settings → Technical → Email → Email Templates
  2. Click Create
  3. Set Name (internal reference)
  4. Select Applies to (model: sale.order, account.move, etc.)
  5. Design Subject and Body with placeholders
  6. Test with Preview button

Common Template Types

TemplateApplies ToTrigger
Quotation Sentsale.orderSend Quotation button
Invoice Reminderaccount.moveAutomated action or manual
Order Confirmationsale.orderOrder confirmed
Delivery Notificationstock.pickingDelivery validated
Welcome Emailres.partnerContact created

Email Actions

Sending Emails Manually

  1. Open the record (order, invoice, etc.)
  2. Click Send by Email or Send & Print
  3. Review/edit the pre-filled template
  4. Click Send

Automated Email Sending

Use Automated Actions to send emails automatically:

TriggerActionExample
On CreateSend EmailWelcome email for new contacts
On Update (state change)Send EmailConfirmation when order confirmed
Based on dateSend EmailReminder 3 days before deadline
ScheduledSend EmailWeekly summary every Monday

Mail Queue

Emails don't send immediately - they go to a queue processed by a scheduled action.

Queue Status

StatusMeaningAction
OutgoingWaiting to be sentWill send on next cron run
SentSuccessfully delivered to SMTPDone
ExceptionFailed to sendCheck error, retry
CancelledManually cancelledWon't send

Location: Settings → Technical → Email → Emails

Force Send

To send queued emails immediately:

  1. Go to Settings → Technical → Automation → Scheduled Actions
  2. Find Mail: Email Queue Manager
  3. Click Run Manually

Troubleshooting Email Issues

Common Problems

ProblemPossible CauseSolution
Emails not sendingOutgoing server misconfiguredCheck SMTP settings, test connection
Emails in outbox stuckScheduled action not runningRun mail queue manually
Customer not receivingSpam filters, wrong email addressCheck contact's email, ask to check spam
Incoming emails not creating recordsAlias not configuredSet up alias in module settings
Replies not linking to recordsCatchall not configuredConfigure catchall alias
Authentication failedWrong passwordUse app-specific password
SSL/TLS errorWrong port or security settingMatch port to security type

Debugging Steps

  1. Check outgoing server:

    • Settings → Technical → Outgoing Mail Servers
    • Click Test Connection
  2. Check mail queue:

    • Settings → Technical → Email → Emails
    • Look for failed emails with error messages
  3. Check scheduled actions:

    • Settings → Technical → Automation → Scheduled Actions
    • Find "Mail: Email Queue Manager"
    • Check Last Execution and Next Execution
  4. Check server logs:

    • Look for SMTP connection errors
    • Authentication failures

Email Validation

CheckWhereWhat to Verify
SPF recordDNSAuthorize Odoo's server to send
DKIMDNS + ServerSign emails cryptographically
DMARCDNSPolicy for handling failures
Reverse DNSServerIP resolves to domain

Mass Mailing

Email Marketing Module

For marketing campaigns, use the Email Marketing module:

FeatureDescription
Mailing ListsManage subscriber lists
CampaignsGroup related mailings
A/B TestingTest subject lines
TemplatesDrag-and-drop email builder
StatisticsOpens, clicks, bounces
AutomationTriggered email sequences

Mass Mailing vs Transactional Email

AspectMass MailingTransactional Email
PurposeMarketing, newslettersOrder confirmations, invoices
RecipientsMany (mailing list)One (specific contact)
UnsubscribeRequiredNot applicable
TemplateMarketing-focusedDocument-focused
TrackingOpens, clicksDelivery status

Email Best Practices

For Consultants

  1. Test templates - Always preview before enabling
  2. Check spam score - Avoid spam trigger words
  3. Verify sender - Use authenticated domain
  4. Monitor queue - Check for stuck emails regularly
  5. Document aliases - Keep list of configured aliases

For Deliverability

  1. Use custom domain - Not generic Gmail
  2. Configure SPF/DKIM - Authenticate your domain
  3. Warm up IP - Gradually increase sending volume
  4. Clean lists - Remove bounced emails
  5. Respect opt-outs - Honor unsubscribe requests

Knowledge Check

Q1: Emails are stuck in the outbox and not sending. What should you check first?

Answer: Check if the Mail Queue scheduled action is running

Go to Settings → Technical → Automation → Scheduled Actions. Find "Mail: Email Queue Manager" and verify it's active and running. You can click "Run Manually" to force processing.

Q2: Customer replies to an invoice email but it doesn't appear on the invoice. Why?

Answer: Catchall alias is not configured or not matching

The catchall alias routes replies to the correct records. Check Settings → Technical → Parameters → Alias Domain, and ensure the catchall is properly configured and the email format matches.

Q3: How do you create a new CRM lead from incoming emails?

Answer: Configure an email alias for the CRM module

Go to CRM → Configuration → Settings. Set up an alias (e.g., "sales"). Emails sent to sales@yourdomain.com will automatically create new leads.

Q4: What's the difference between Send Message and Log Note for email?

Answer: Send Message can trigger emails to followers; Log Note never sends emails

Send Message may send actual emails to followers (depending on their notification preferences). Log Note is purely internal and never generates outgoing email.

Q5: Gmail authentication keeps failing even with the correct password. What's wrong?

Answer: You need to use an App Password, not your regular Gmail password

Gmail requires App Passwords for "less secure apps" like Odoo. Enable 2FA on your Google account, then generate an App Password specifically for Odoo.