Odoo 19.0 Community · Persistent

mail.mail: fields, relations and API

The mail.mail model ("Outgoing Mails") is a persistent model declared by the Discuss module, then extended by 1 other module. It exposes 27 fields, 21 of them declared directly on the model; 2 fields from other models point to it. Below you will find every field with its technical name, type, label and relations, followed by an Odoo 19 JSON-2 API call.

Model identity

Technical name
mail.mail
Label
Outgoing Mails
Type
Persistent (models.Model)
SQL table
mail_mail
Origin module
Discuss (mail)
Extended by
mass_mailing
Default order (_order)
id desc
Display field (_rec_name)
subject
Delegation (_inherits)
mail.message: fields of this model are also available, through mail_message_id

Model fields

21 own fields, 0 inherited from mixins and 6 automatic ORM fields. Click a name to get a direct link to that field.

27 of 27 fields shown

Technical nameLabelTypeDetails
auto_deleteAuto Delete

This option permanently removes any track of email after it's been sent, including from the Technical menu in the Settings, in order to preserve storage space of your Odoo database.

boolean
body_contentRich-text Contentshtml
computed
body_htmlText Contents

Rich-text/HTML message

text
email_ccCc

Carbon copy message recipients

char
email_toTo

Message recipients (emails)

text
failure_reasonFailure Reason

Failure reason. This is usually the exception thrown by the email server, stored to ease the debugging of mailing issues.

text
read-only
failure_typeFailure typeselection

Values: unknown (Unknown error), mail_spam (Detected As Spam), mail_email_invalid (Invalid email address), mail_email_missing (Missing email), mail_from_invalid (Invalid from address), mail_from_missing (Missing from address), mail_smtp (Connection failed (outgoing mail server problem)), mail_bl (Blacklisted Address), mail_optout (Opted Out), mail_dup (Duplicated Email)

fetchmail_server_idInbound Mail Servermany2one
read-only
headersHeaderstext
is_notificationNotification Email

Mail has been created to notify people of an existing mail.message

boolean
mail_message_idMessagemany2one
required
mail_message_id_intMail Message Id Intinteger
computed
mailing_idMass Mailingmany2one

added by Email Marketing (mass_mailing)

mailing_trace_idsStatisticsone2many

inverse: mail_mail_id

added by Email Marketing (mass_mailing)

message_typeMessage Typeselection

related: mail_message_id.message_type

recipient_idsTo (Partners)many2many
referencesReferences

Message references, such as identifiers of previous messages

text
read-only
restricted_attachment_countRestricted attachmentsinteger
computed
scheduled_dateScheduled Send Date

If set, the queue manager will send the email after the date. If not set, the email will be send as soon as possible. Unless a timezone is specified, it is considered as being in UTC timezone.

datetime
stateStatusselection
read-only

Values: outgoing (Outgoing), sent (Sent), received (Received), exception (Delivery Failed), cancel (Cancelled)

unrestricted_attachment_idsUnrestricted Attachmentsmany2many
computed
create_dateCreated ondatetime
read-onlyautomatic
create_uidCreated bymany2one
read-onlyautomatic
display_nameDisplay Namechar
read-onlycomputedautomatic
idIDinteger
read-onlyautomatic
write_dateLast Updated ondatetime
read-onlyautomatic
write_uidLast Updated bymany2one
read-onlyautomatic

Relations

Models linked from this model

Fields of other models pointing here

Reading this model through the API

Odoo 19 JSON-2 API call reading the first five records with real fields of the model. Replace the instance, database and API key with your own.

curl
curl -X POST "https://your-instance.odoo.com/json/2/mail.mail/search_read" \
  -H "Authorization: bearer $ODOO_API_KEY" \
  -H "X-Odoo-Database: your-db" \
  -H "Content-Type: application/json" \
  -d '{"domain":[],"fields":["mail_message_id","state","fetchmail_server_id","mailing_id","auto_delete"],"limit":5}'
Python (requests)
import requests

BASE_URL = "https://your-instance.odoo.com/json/2"
headers = {"Authorization": f"bearer {API_KEY}", "X-Odoo-Database": "your-db"}

res = requests.post(
    f"{BASE_URL}/mail.mail/search_read",
    headers=headers,
    json={"domain": [], "fields": ["mail_message_id","state","fetchmail_server_id","mailing_id","auto_delete"], "limit": 5},
)
res.raise_for_status()
print(res.json())
  • External API access requires Odoo's Custom plan.
  • XML-RPC and JSON-RPC will be removed in Odoo 22 (fall 2028): use JSON-2.
  • The access rights and record rules of the key's user apply.

Cite this tool

Writing a tutorial, internal documentation or a forum answer? Copy this link to send your readers to the up-to-date reference.

<a href="https://aidoo.ai/en/outils/explorateur-modeles-odoo/mail-mail">mail.mail (Odoo 19.0)</a>

Sources

Data verified on September 23, 2026 · Odoo 19.0 Community

Have an Odoo project, or want to put your ERP to work with AI? Let's talk

Implementation, custom module development, connecting Claude or ChatGPT to your data: tell us about your context and we will reply within 24 business hours.