> ## 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.

# outbox table

> Outgoing emails with sending status and other info

## outbox Table (351)

Outgoing emails with sending status and other info

## Fields

| Name            | Description                                                                                 | Type                               | Nullable |
| --------------- | ------------------------------------------------------------------------------------------- | ---------------------------------- | :------: |
| id              | Primary key                                                                                 | PK                                 |    No    |
| ticket\_id      | The ticket.id this reference is connected to.                                               | FK [ticket](./ticket.mdx)          |    Yes   |
| message\_id     | The message.id this reference is connected to.                                              | FK [ej\_message](./ej-message.mdx) |    Yes   |
| subject         | Subject of the mail                                                                         | String(255)                        |    No    |
| from\_email     | Mail address of the sender                                                                  | String(255)                        |    No    |
| from\_envelope  | Envelope (smtp) Mail address of the sender                                                  | String(255)                        |    No    |
| rcpt            | A list of recipience                                                                        | Clob                               |    Yes   |
| mail\_size      | The size of the mail in bytes                                                               | Int                                |    No    |
| created         | When the mail was created                                                                   | DateTime                           |    Yes   |
| status          | Status enum                                                                                 | Int                                |    No    |
| retries         | The number of times we have tried to send this mail                                         | Int                                |    No    |
| next\_retry     | When is the next time we should try again?                                                  | DateTime                           |    Yes   |
| pid             | The process id owning this message                                                          | Int                                |    No    |
| last\_error     | The last error reported when sending this message                                           | String(255)                        |    Yes   |
| type            | Indicates if this is a SMS to be sent via WebServices or a normal email. 0 = email, 1 = sms | type                               |    No    |
| rfc822\_content | The content of the outgoing email as a string. Alternative to using outbox file             | Clob                               |    Yes   |

<img src="https://mintcdn.com/superofficeas/6OcOTPa_ISkjXJg4/media/loc/en/database/tables/outbox.png?fit=max&auto=format&n=6OcOTPa_ISkjXJg4&q=85&s=f459457117b7a25818c60069c928f7f2" alt="outbox table relationship diagram" width="588" height="591" data-path="media/loc/en/database/tables/outbox.png" />

## Indexes

| Fields      | Types | Description |
| ----------- | ----- | ----------- |
| ticket\_id  | FK    | Index       |
| message\_id | FK    | Index       |

## Relationships

| Table                       | Description                                                                              |
| --------------------------- | ---------------------------------------------------------------------------------------- |
| [ej\_message](./ej-message) | This table contains the messages listed under tickets.                                   |
| [sms](./sms)                | This table will hold outgoing sms messages when transmitted with WebServices             |
| [ticket](./ticket)          | This table contains the tickets (requests) of the system. Its purpose should be evident. |

## Replication Flags

* None

## Security Flags

* No access control via user's Role.


## Related topics

- [Creating a trigger for the outbox](/en/automation/crmscript/tutorials/crmscript-trigger-outbox.md)
- [ejOutbox](/en/onsite/automated-tasks/ejoutbox.md)
- [sms table](/en/database/tables/sms.md)
- [ej_message table](/en/database/tables/ej-message.md)
- [ticket table](/en/database/tables/ticket.md)
- [Trigger](/en/automation/trigger/reference/CRMScript.Event.Trigger.md)
