Arawa Mail Arawa MailDocs

Mailgun Messages

Arawa Mail includes a Mailgun-compatible send endpoint for integrations that can point Mailgun clients at a custom host.

POST /v3/{domain}/messages

Example

curl -s --user "api:your_api_key" \
  "https://app.arawamail.com/v3/example.com/messages" \
  -F from="Acme <[email protected]>" \
  -F to="[email protected]" \
  -F subject="Hello from Arawa Mail" \
  -F html="<p>Sent through the Mailgun-compatible endpoint.</p>"

Response

{
  "id": "<[email protected]>",
  "message": "Queued. Thank you."
}

Form Parameters

Parameter Type Required Description
from string Yes Sender address. Must match {domain}.
to string or repeated field Yes Recipient address or addresses. Comma-separated values are accepted.
subject string No Email subject.
html string Required without text HTML body.
text string Required without html Plain text body.
cc string or repeated field No Carbon copy recipients.
bcc string or repeated field No Blind carbon copy recipients.
h:Reply-To string No Reply-To address.
h:* string No Custom headers.
attachment file or files No File attachments.

Notes

The endpoint supports Mailgun-style basic auth with username api and the Arawa Mail API key as the password.

Laravel Integration

Because the endpoint is Mailgun-compatible, you can use Laravel's built-in Mailgun mailer without any custom code — just point it at Arawa Mail.

1. Update your .env

Add or change the following values in your Laravel application's .env file:

# Tell Laravel to send mail through the Mailgun driver.
# This is the value most people forget — mail will not use Arawa Mail until it is set.
MAIL_MAILER=mailgun

# Your Arawa Mail sending domain (replace the placeholder).
MAILGUN_DOMAIN=your-domain.com

# Your Arawa Mail API key (replace the placeholder).
MAILGUN_SECRET=your_api_key_here

# Arawa Mail Mailgun-compatible host for this deployment.
MAILGUN_ENDPOINT=app.arawamail.com

Only three lines need real values from you:

  • MAIL_MAILER — set to mailgun so Laravel routes outbound mail to Arawa Mail instead of the default driver. Do not leave this as smtp/log.
  • MAILGUN_DOMAIN — replace your-domain.com with a domain you have already onboarded and enabled for sending. See Onboard a Domain and Enable Sending. The domain must be sending-active or requests will be rejected.
  • MAILGUN_SECRET — replace your_api_key_here with an API key that has the sending scope. Create one in the Arawa Mail dashboard; see API Keys. The full key is shown only once at creation, so copy it immediately.

MAILGUN_ENDPOINT is the host of this Arawa Mail deployment (app.arawamail.com).

2. Confirm config/services.php

Do not skip this step. Open your config/services.php and make sure the Mailgun block contains all four lines below — especially the endpoint line:

'mailgun' => [
    'domain' => env('MAILGUN_DOMAIN'),
    'secret' => env('MAILGUN_SECRET'),
    'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
    'scheme' => 'https',
],

Missing `endpoint` key = mail silently goes to the wrong host Many Laravel apps (older projects, or ones with a trimmed `services.php`) only have `domain` and `secret` in this block. When the `endpoint` key is missing, Laravel ignores your `MAILGUN_ENDPOINT` env value entirely and sends every message to Mailgun's real API at `api.mailgun.net` — where your Arawa Mail key is invalid, so sending fails. If mail is failing after step 1, this is the first thing to check.

3. Send

After clearing config cache (php artisan config:clear), any mail you send goes through Arawa Mail:

use Illuminate\Support\Facades\Mail;

Mail::raw('Sent through Arawa Mail via the Mailgun driver.', function ($message) {
    $message->from('[email protected]')
        ->to('[email protected]')
        ->subject('Hello from Arawa Mail');
});

The from address must belong to your MAILGUN_DOMAIN and, if the API key is domain-restricted, to that key's domain as well.