Once Laravel Maily is configured andDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/yugo412/laravel-maily/llms.txt
Use this file to discover all available pages before exploring further.
MAIL_MAILER=maily is set in your .env, all outgoing mail is automatically routed through the Maily transport. You do not need to change any existing Mailable classes or Mail facade calls — the transport is a drop-in replacement that works transparently beneath Laravel’s standard mail layer.
Raw email
Send a quick plain-text message without creating aMailable class by passing a string directly to Mail::raw():
Mailable.
Mailable classes
Send any existingMailable exactly as you would with any other Laravel mail driver:
Mailable class are required. The transport intercepts the compiled message after Laravel renders it and forwards it to the Maily API.
Queued mail
Defer delivery to a background queue job usingqueue() instead of send():
From address formatting
The transport automatically formats sender addresses before sending them to the Maily API. When a display name is present, the address is rendered asName <email@example.com>; when no name is set, only the bare email address is used.
This is handled internally by the formatAddress method in MailyTransport:
from address configured as Address('hello@example.com', 'Your App') will be sent to the API as Your App <hello@example.com>.
What the transport sends
On every send, the transport makes aPOST /api/v1/emails/send request to the Maily API with the following JSON body:
| Field | Type | Description |
|---|---|---|
from | string | null | Formatted sender address (e.g., Your App <hello@example.com>). |
to | string | null | Formatted recipient address (e.g., User <user@example.com>). |
subject | string | null | The email subject line. |
html | string | null | HTML body of the message, if one is set. |
text | string | null | Plain-text body of the message, if one is set. |
X-API-Key header populated from services.maily.key.
Only a single recipient is supported per send. Passing more than one address to
->to() will throw a MailyException before the API is contacted. To send the same message to multiple recipients, loop over them and call Mail::to($recipient)->send(...) individually.