Overview
Messages are the core of Jasni. Every email you send, receive, reply to, or forward is a message. The API provides full control over message operations.Message Structure
| Field | Type | Description |
|---|---|---|
uid | integer | Unique identifier within the mailbox |
messageId | string | RFC 2822 Message-ID header |
from | string | Sender email address |
to | string[] | Recipient email addresses |
cc | string[] | CC recipients |
bcc | string[] | BCC recipients (only visible to sender) |
subject | string | Email subject line |
date | datetime | When the email was sent/received |
text | string | Plain text body |
html | string | HTML body |
attachments | object[] | List of attachments |
flags | string[] | IMAP flags (e.g., \Seen, \Flagged) |
Operations
Send a Message
List Messages
Read a Message
Update Message Status
Mark as read:Delete a Message
Deleting a message moves it to the Trash folder. It is not permanently deleted immediately.
Message Flags
Messages can have the following flags:| Flag | Description |
|---|---|
\Seen | Message has been read |
\Flagged | Message is flagged/starred |
\Draft | Message is a draft |
\Answered | Message has been replied to |
Best Practices
Provide both text and HTML
Provide both text and HTML
Some email clients don’t render HTML. Always include a plain text fallback.
Use webhooks for incoming messages
Use webhooks for incoming messages
Instead of polling, set up a webhook for
email.received events to get instant notifications.Validate recipients
Validate recipients
Always validate email addresses before sending to avoid bounces and protect your sender reputation.