# Send Mail With Template

Sends an e-mail using a defined template. Template parameters are passed with `DataTable`.


---

### :arrow_left:**INPUT**

| **Parameter** | **Type** | **Required** | **Description** |
|-----------|------|----------|-------------|
| `MailName` | `String` | ❌No      | Mail configuration name |
| `TemplateName` | `String` | ✅**Yes** | Name of the template to use |
| `FromName` | `String` | ❌No      | Sender name (override) |
| `To`      | `String` | ✅**Yes** | Recipient addresses |
| `Cc`      | `String` | ❌No      | CC addresses |
| `Bcc`     | `String` | ❌No      | BCC addresses |
| `Subject` | `String` | ❌No      | Subject (override) |
| `Attachment` | `List<PAWMailAttachment>` | ❌No      | Attachment file list |
| `AttachmentFolderPath` | `String` | ❌No      | Attachment file folder path |
| `Parameters` | `DataTable` | ❌No      | Template parameters |
| `DoNotLog` | `Boolean` | ❌No      | Whether to skip logging |
| `Importance` | `Int32?` | ❌No      | Importance level (0=Low, 1=Normal, 2=High). Default: 1 |


---

### :arrow_right:**OUTPUT**

| **Parameter** | **Type** | **Description** |
|-----------|------|-------------|
| `IsSendMailWithTemplateSuccessful` | `Boolean` | Whether the send succeeded |
| `SendMailWithTemplateMessage` | `String` | Result/error message |
| `MailSentId` | `Guid?` | ID of the sent mail |


---

### :arrow_down:**MISC**

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