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 name | Label | Type | Details |
|---|---|---|---|
| auto_delete | Auto 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_content | Rich-text Contents | html | computed |
| body_html | Text Contents Rich-text/HTML message | text | |
| email_cc | Cc Carbon copy message recipients | char | |
| email_to | To Message recipients (emails) | text | |
| failure_reason | Failure 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_type | Failure type | selection | Values: |
| fetchmail_server_id | Inbound Mail Server | many2one | read-only |
| headers | Headers | text | |
| is_notification | Notification Email Mail has been created to notify people of an existing mail.message | boolean | |
| mail_message_id | Message | many2one | required |
| mail_message_id_int | Mail Message Id Int | integer | computed |
| mailing_id | Mass Mailing | many2one | added by Email Marketing ( |
| mailing_trace_ids | Statistics | one2many | inverse: added by Email Marketing ( |
| message_type | Message Type | selection | related: |
| recipient_ids | To (Partners) | many2many | |
| references | References Message references, such as identifiers of previous messages | text | read-only |
| restricted_attachment_count | Restricted attachments | integer | computed |
| scheduled_date | Scheduled 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 | |
| state | Status | selection | read-only Values: |
| unrestricted_attachment_ids | Unrestricted Attachments | many2many | computed |
| create_date | Created on | datetime | read-onlyautomatic |
| create_uid | Created by | many2one | read-onlyautomatic |
| display_name | Display Name | char | read-onlycomputedautomatic |
| id | ID | integer | read-onlyautomatic |
| write_date | Last Updated on | datetime | read-onlyautomatic |
| write_uid | Last Updated by | many2one | read-onlyautomatic |
Relations
Models linked from this model
- fetchmail.server: fetchmail_server_id
- ir.attachment: unrestricted_attachment_ids
- mail.message: mail_message_id
- mailing.mailing: mailing_id
- mailing.trace: mailing_trace_ids
- res.partner: recipient_ids
Fields of other models pointing here
- mail.notification: mail_mail_id
- mailing.trace: mail_mail_id
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 -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}'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.