messageSent
The messageSent webhook event is triggered when EmailEngine successfully delivers a queued email to the SMTP server (or Gmail/Outlook API). This event confirms that the message has been accepted for delivery by the mail transfer agent (MTA).
When This Event is Triggered
The messageSent event fires when:
- A message submitted via the Submit API is accepted by the SMTP server
- An email sent through Gmail API is successfully delivered
- An email sent through Microsoft Graph API is successfully delivered
- The SMTP server returns a 250 OK response
This event indicates successful handoff to the mail server. It does not guarantee final delivery to the recipient's inbox, as the message may still bounce or be rejected by downstream servers.
Common Use Cases
- Delivery confirmation - Update your application when emails are successfully queued for delivery
- Tracking correlation - Associate the EmailEngine queue ID with the MTA's message ID
- Audit logging - Maintain a log of all successfully sent emails
- Workflow triggers - Initiate follow-up actions after email is sent
- Analytics - Track send volumes and success rates per account
- CRM integration - Update contact records with communication history
Payload Schema
Top-Level Fields
| Field | Type | Required | Description |
|---|---|---|---|
serviceUrl | string | No | The configured EmailEngine service URL |
account | string | Yes | Account ID that sent the message |
date | string | Yes | ISO 8601 timestamp when the webhook was generated |
event | string | Yes | Event type, always "messageSent" for this event |
data | object | Yes | Event data object (see below) |
Data Object Fields
| Field | Type | Required | Description |
|---|---|---|---|
messageId | string | Yes | Message-ID header of the sent email (may be assigned by MTA) |
originalMessageId | string | No | Original Message-ID if the MTA assigned a different one |
response | string | No | SMTP server response (for SMTP submissions only) |
queueId | string | Yes | EmailEngine's internal queue ID for this submission |
envelope | object | Yes | SMTP envelope with sender and recipients |
networkRouting | object | No | Network routing information (if local address or proxy was used) |
Envelope Object Structure
| Field | Type | Description |
|---|---|---|
from | string | Envelope sender (MAIL FROM address) |
to | array | Array of envelope recipient addresses (RCPT TO) |
Network Routing Object Structure
Present only when a custom local address or proxy is configured:
| Field | Type | Description |
|---|---|---|
localAddress | string | Local IP address used for the SMTP connection |
proxy | string | SOCKS proxy URL used for the connection |
name | string | EHLO hostname used in the SMTP session |
requestedLocalAddress | string | Originally requested local address (if different from actual) |
Example Payload
Standard SMTP Submission
{
"serviceUrl": "https://emailengine.example.com",
"account": "user123",
"date": "2025-10-17T06:46:26.954Z",
"event": "messageSent",
"data": {
"messageId": "<305eabf4-9538-2747-acec-dc32cb651a0e@example.com>",
"response": "250 2.0.0 Ok: queued as 9441D8220E",
"queueId": "183e4b18f0ffe977476",
"envelope": {
"from": "sender@example.com",
"to": ["recipient@destination.com"]
}
}
}