> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wazobiamail.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# WordPress Plugin

> Install the WazobiaMail WordPress plugin to route wp_mail() through the WazobiaMail API with domain DNS automation and delivery receipts.

The official WordPress plugin replaces the default `wp_mail()` transport with the WazobiaMail API. It works with contact forms, WooCommerce, password resets and any plugin that uses WordPress mail — without changing those plugins.

> [card] [GitHub repository](https://github.com/WazobiaMail/wazobiamail-wordpress)
>
> WazobiaMail/wazobiamail-wordpress

> [card] [Release ZIP](https://github.com/WazobiaMail/wazobiamail-wordpress/releases)
>
> Install from the latest release

## At a glance

| | |
| - | - |
| Runtime | WordPress 5.8+, PHP 7.4+ |
| Distribution | [Packagist](https://packagist.org/packages/wazobiamail/wazobiamail-wordpress), GitHub release ZIP, WordPress.org submission prepared |
| Install | Upload the plugin ZIP and activate |
| Auth | WazobiaMail API key in **Settings → WazobiaMail** |
| Source | [github.com/WazobiaMail/wazobiamail-wordpress](https://github.com/WazobiaMail/wazobiamail-wordpress) |

## Install

1. Download the latest plugin ZIP from [GitHub Releases](https://github.com/WazobiaMail/wazobiamail-wordpress/releases).
2. In WordPress, go to **Plugins → Add New → Upload Plugin**.
3. Upload the ZIP, click **Install Now**, then **Activate**.
4. Open **Settings → WazobiaMail** and paste your `wzbm_...` API key.
5. Optionally set the From name/email and send a test message.

If you build from source, the plugin lives in `sdks/wordpress` and is a standard WordPress plugin directory.

Composer users can install the package directly:

```bash theme={null}
composer require wazobiamail/wazobiamail-wordpress
```

With `composer/installers` in the root project, the `wordpress-plugin` package installs into `wp-content/plugins/wazobiamail`.

## Configure

The settings screen stores:

* API key (masked after saving; the original secret is never overwritten by the masked value).
* From name and From email fallback.
* Delivery logging and the Active/Disabled dispatch switch.
* Domain registration and DNS verification state.

The plugin registers the site domain automatically, then shows the required SPF, DKIM, DMARC, MX and ownership records. Use the verification action after publishing them.

## Sending

Every `wp_mail()` call is routed through the API:

```php theme={null}
wp_mail(
    'customer@example.com',
    'Your order shipped',
    '<p>Your order is on its way.</p>',
    ['Content-Type: text/html; charset=UTF-8', 'Cc: accounting@example.com'],
    ['/var/www/uploads/invoice.pdf']
);
```

The plugin maps `Cc`, `Bcc`, `From`, `Reply-To`, `Content-Type` and `Idempotency-Key` headers, uploads local attachments to WazobiaMail storage, and sends URL attachments in the API payload. Upload failures abort the send instead of silently dropping files.

## Domain and DNS automation

* Detects the site host from WordPress.
* Registers or reuses the sending domain in WazobiaMail.
* Displays the exact DNS records needed for sending and receiving.
* Triggers DNS verification and reports per-record status.
* Keeps the latest 50 delivery receipts in the admin screen.

## Delivery logs

The settings screen shows recent sends, tracking IDs, recipients, status and errors. Logging can be disabled in settings. The log is local to WordPress; the WazobiaMail dashboard remains the source of truth for full delivery history.

## Hooks and integrations

The plugin integrates through WordPress's normal mail flow (`pre_wp_mail` / `wp_mail_failed`) and the plugin action links. It does not require a custom form integration: if a plugin calls `wp_mail()`, it is covered.

## Troubleshooting

* **No email leaves the site:** confirm the API key is saved and the dispatch switch is Active.
* **401/403:** rotate the API key in WazobiaMail and save it again in settings.
* **DNS not verified:** publish every record shown, wait for propagation, then rerun verification.
* **Attachments fail:** the API accepts up to 10 MB per file and 5 MB total per send with at most 10 URL attachments. Upload failures are reported instead of being dropped.

## Links

* [GitHub](https://github.com/WazobiaMail/wazobiamail-wordpress)
* [Releases](https://github.com/WazobiaMail/wazobiamail-wordpress/releases)
* [Full README](https://github.com/WazobiaMail/wazobiamail-wordpress#readme)
* [All official SDKs](https://docs.wazobiamail.com/docs/guides/sdks.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.