> Send Laravel Mailables and Django emails through Vaartix by switching the mail driver or backend, then add bounce webhooks.

Source: https://vaartix.com/blog/laravel-django-mail-driver

[Blog](https://vaartix.com/blog)

# Laravel and Django: switch your mail driver to Vaartix in one afternoon

25 November 2026 · 3 min read · Vaartix team

-   [Developers](https://vaartix.com/blog/tag/developers)

If your app is built on Laravel or Django, you probably already send email the framework way: Mailables and notifications in Laravel, `send_mail` and the built-in password-reset emails in Django. Switching to Vaartix doesn't mean rewriting any of that. You change the mail driver, and everything your app already sends goes through Vaartix.

## Before you start

-   [Sign up free](https://app.vaartix.com/?signup) and create an API key under **API keys**. Give your app a **send-only** key: if it ever leaks, it can't read your email history or create more keys.
-   Until you [verify your domain](https://vaartix.com/docs/domains/verify/), a new account can send only to test addresses. That's enough to try everything below: send from `@test.vaartix.com` to `delivered@test.vaartix.com`.

## Laravel: the vaartix mail driver

The PHP SDK registers a `vaartix` mail driver automatically on Laravel 12 and 13, so the `Mail` facade, Mailables, notifications and queued mail all go through Vaartix.

```
composer require vaartix/vaartix-php
```

Then point Laravel at it:

```
# .env
MAIL_MAILER=vaartix
MAIL_FROM_ADDRESS=noreply@acme.in
VAARTIX_API_KEY=vx_live_...
```

```
// config/services.php
'vaartix' => [
    'key' => env('VAARTIX_API_KEY'),
],

// config/mail.php, inside 'mailers'
'vaartix' => [
    'transport' => 'vaartix',
],
```

That's it. `Mail::to($user)->send(new OrderConfirmed($order))` now sends through Vaartix. Laravel's `->tag()` and `->metadata()` become Vaartix tags, so you can filter by them in the dashboard. The full guide is [Send email from Laravel](https://vaartix.com/docs/guides/laravel/).

## Django: the vaartix email backend

The Python SDK includes a Django email backend (Django 4.2 and later), so `send_mail`, `EmailMessage` and Django's own emails, such as password resets, all go through Vaartix.

```
pip install "vaartix[django]"
```

```
# settings.py
import os

VAARTIX_API_KEY = os.environ["VAARTIX_API_KEY"]
DEFAULT_FROM_EMAIL = "Acme <noreply@acme.in>"

# Django 6.1 and newer
MAILERS = {"default": {"BACKEND": "vaartix.django.EmailBackend"}}

# Django 4.2 to 6.0
EMAIL_BACKEND = "vaartix.django.EmailBackend"
```

Use the setting that matches your Django version. HTML alternatives, attachments, inline images, cc, bcc, reply-to and custom headers all work, and after sending, `message.vaartix_id` holds the Vaartix email ID. The full guide is [Send email from Django](https://vaartix.com/docs/guides/django/).

## Hear about bounces in your app

Once mail is flowing, add a webhook so your app knows when an address bounces or someone reports spam. Both SDKs verify the signature for you. Two things to remember in both frameworks:

-   **Exempt the webhook route from CSRF protection.** Requests come from Vaartix, not from a browser form; the signature check is what keeps it safe.
-   **Verify the raw request body**: `$request->getContent()` in Laravel, `request.body` in Django.

Both guides include a ready-to-use webhook route. Our post on [bounces and complaints](https://vaartix.com/blog/bounces-and-complaints) explains what to do with each event.

## An afternoon, not a migration project

1.  Install the SDK and switch the driver or backend (15 minutes).
2.  Send a few test emails to `delivered@test.vaartix.com` and check them in the dashboard's logs.
3.  Verify your domain: publish the DNS records Vaartix gives you. Our [DNS walkthrough](https://vaartix.com/blog/spf-dkim-dmarc-godaddy-hostinger-cloudflare) covers GoDaddy, Hostinger and Cloudflare.
4.  Add the webhook route, deploy, and watch your first real emails arrive.

Prefer SMTP? Any app that speaks SMTP can use `smtp.vaartix.com` on ports 465 or 587, with the username `vaartix` and an API key as the password. See the [SMTP guide](https://vaartix.com/docs/sending/smtp/).

## Related posts

-   [Sending OTPs: delays, retries and what users actually see](https://vaartix.com/blog/otp-email-delays) 30 November 2026
-   [Send email from your AI assistant with the Vaartix MCP server](https://vaartix.com/blog/connect-ai-assistant-mcp) 29 November 2026
-   [Verify webhook signatures in Node, Python and PHP](https://vaartix.com/blog/verify-webhook-signatures) 28 November 2026

**Vaartix is a transactional email API built in India.** It sends through Amazon SES in Mumbai, keeps your data in India and is priced in rupees. Anyone can sign up free, and the Free plan has every feature.

[Sign up free](https://app.vaartix.com/?signup)
