# Get Mail

Retrieves mail information by a work or sent mail ID.


---

### :arrow_left:**INPUT**

| **Parameter** | **Type** | **Required** | **Description** |
|-----------|------|----------|-------------|
| `WorkId`  | `Guid?` | ✅Yes     | ID of the work record |
| `MailSentId` | `Guid?` | ✅Yes     | ID of the sent mail |
| `IncludeMailData` | `Boolean` | ❌No      | Whether to include the raw mail data (byte[]) |


---

### :arrow_right:**OUTPUT**

| **Parameter** | **Type** | **Description** |
|-----------|------|-------------|
| `IsGetMailSuccessful` | `Boolean` | Whether the operation succeeded |
| `GetMailMessage` | `String` | Result/error message |
| `GetMailData` | `Byte[]` | Mail file data (if IncludeMailData=true) |
| `From`    | `String` | Sender address |
| `FromName` | `String` | Sender name |
| `To`      | `String` | Recipient(s) |
| `Cc`      | `String` | CC recipients |
| `Subject` | `String` | Subject     |
| `BodyText` | `String` | Plain text body |
| `BodyHtml` | `String` | HTML body   |
| `BodyHtmlFormatted` | `String` | Formatted HTML body |
| `Attachments` | `List<PAWAttachment>` | Attachment file list |


---

### :arrow_down:**MISC**

| **Parameter** | **Type** | **Default** | **Description** |
|-----------|------|---------|-------------|
| `ThrowException` | `Boolean` | ❌No     | Throw exception on error |