> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# email_item table

> Email data

## email\_item Table (494)

Email data

## Fields

| Name                      | Description                                                      | Type                                            | Nullable |
| ------------------------- | ---------------------------------------------------------------- | ----------------------------------------------- | :------: |
| email\_item\_id           | Primary key                                                      | PK                                              |    No    |
| account\_id               | Account id                                                       | FK [email\_account](./email-account.mdx)        |    Yes   |
| server\_id                | Email server id of this email item                               | Int                                             |    No    |
| flags                     | Email flags - answered, deleted, seen, flagged, draft, recent... | Enum [EMailFlags](./enums/emailflags.mdx)       |    Yes   |
| email\_folder\_id         | Folder this email is in on the imap server                       | FK [email\_folder](./email-folder.mdx)          |    Yes   |
| mime                      | Mime text                                                        | Clob                                            |    Yes   |
| messageId                 | Email MessageId                                                  | String(512)                                     |    Yes   |
| sent\_at                  | Sent datetime from mime                                          | DateTime                                        |    Yes   |
| received\_at              | Received by email server                                         | DateTime                                        |    Yes   |
| subject                   | Email subject                                                    | String(255)                                     |    Yes   |
| plain\_body               | Plain body text                                                  | Clob                                            |    Yes   |
| html\_body                | Html body text                                                   | Clob                                            |    Yes   |
| priority                  | Email priority                                                   | Enum [EMailPriority](./enums/emailpriority.mdx) |    Yes   |
| registered                | Registered when                                                  | UtcDateTime                                     |    No    |
| registered\_associate\_id | Registered by whom                                               | FK [associate](./associate.mdx)                 |    No    |
| updated                   | Last updated when                                                | UtcDateTime                                     |    No    |
| updated\_associate\_id    | Last updated by whom                                             | FK [associate](./associate.mdx)                 |    No    |
| updatedCount              | Number of updates made to this record                            | UShort                                          |    No    |
| has\_attachment           | Has attachment(s)                                                | Bool                                            |    Yes   |
| from                      | From address                                                     | String(4000)                                    |    Yes   |
| to                        | To                                                               | String(4000)                                    |    Yes   |
| size                      | The size of the email                                            | Int                                             |    No    |
| person\_id                | From person                                                      | FK [person](./person.mdx)                       |    Yes   |
| contact\_id               | From company                                                     | FK [contact](./contact.mdx)                     |    Yes   |
| document\_id              | Archived document                                                | FK [document](./document.mdx)                   |    Yes   |
| appointment\_id           | Archived on appointment                                          | FK [appointment](./appointment.mdx)             |    Yes   |
| sale\_id                  | Archived on sale                                                 | FK [sale](./sale.mdx)                           |    Yes   |
| replied\_at               | When this email was replied to                                   | DateTime                                        |    Yes   |
| in\_reply\_to             | In reply to, a message-id, used for threading                    | String(512)                                     |    Yes   |
| cc                        | Cc                                                               | String(4000)                                    |    Yes   |
| cal\_data                 | Calendar data                                                    | Clob                                            |    Yes   |
| server\_identifier        | Server identifier of this email item (GraphApi uses string Id's) | String(1024)                                    |    No    |

<img src="https://mintcdn.com/superofficeas/i6M2qZmvMNH7UTeu/media/loc/en/database/tables/email_item.png?fit=max&auto=format&n=i6M2qZmvMNH7UTeu&q=85&s=825d15d2435d0a64284cd8538c2a4eb2" alt="email_item table relationship diagram" width="874" height="756" data-path="media/loc/en/database/tables/email_item.png" />

## Indexes

| Fields                  | Types        | Description |
| ----------------------- | ------------ | ----------- |
| server\_id              | Int          | Index       |
| account\_id             | FK           | Index       |
| account\_id, server\_id | FK, Int      | Index       |
| messageId               | String(512)  | Index       |
| email\_folder\_id       | FK           | Index       |
| server\_identifier      | String(1024) | Index       |

## Relationships

| Table                                   | Description                                                                                                                                                                                                                                                                                                                               |
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [appointment](./appointment)            | Tasks, appointments, followups, phone calls; and documents (document\_id != 0). An appointment always has a corresponding record in VisibleFor specifying who may see this.                                                                                                                                                               |
| [associate](./associate)                | Employees, resources and other users - except for External persons                                                                                                                                                                                                                                                                        |
| [contact](./contact)                    | Companies and Organizations.                                                                                                                                                                                                                                                                                                              |
| [document](./document)                  | Documents, this table is an extension of the Appointment table.  There is always a corresponding appointment record; the relation between appointment and document is navigable in both directions. A document-type appointment record always has a corresponding document record and a record in VisibleFor specifying who may see this. |
| [email\_account](./email-account)       | Email account information                                                                                                                                                                                                                                                                                                                 |
| [email\_attachment](./email-attachment) | Attachment info related to an email\_item                                                                                                                                                                                                                                                                                                 |
| [email\_folder](./email-folder)         | Corresponds to an email folder on a mail server                                                                                                                                                                                                                                                                                           |
| [person](./person)                      | Persons                                                                                                                                                                                                                                                                                                                                   |
| [sale](./sale)                          | Sales  For every Sale record edited through the SuperOffice GUI, a copy of the current version of the record will be saved in the SaleHist table. This also applies to editing done through the SaleModel COM interface, but not to editing done through the OLE DB Provider or other channels.                                           |

## Replication Flags

* None

## Security Flags

* No access control via user's Role.


## Related topics

- [email_attachment table](/en/database/tables/email-attachment.md)
- [email_folder table](/en/database/tables/email-folder.md)
- [email_account table](/en/database/tables/email-account.md)
- [What's new in version 12.0.342.0](/release-notes/database/changes-12.0.342.md)
- [What's new in version 12.1.1412.0](/release-notes/database/changes-12.1.1412.md)
- [What's new in version 12.2.2072.0](/release-notes/database/changes-12.2.2072.md)
