=== Kelune SMTP – SMTP Mailer, Email Log, Fallback & Delivery Reports ===
Contributors: devitemsllc, nazmulhudadev, aslamhasib
Tags: smtp, email, mailer, email log, email delivery
Requires at least: 6.6
Tested up to: 7.1
Stable tag: 1.0.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Fix WordPress email delivery: send through SMTP, Amazon SES, Mailgun or SendGrid, with logs, fallback and health checks. Self-hosted and free.

== Description ==

= WordPress email delivery through SMTP, Amazon SES, Mailgun or SendGrid, with logs, fallback and health checks =

Kelune SMTP takes over WordPress email and sends it through a connection you configure — classic SMTP, or an API provider such as Amazon SES, Mailgun or SendGrid. Every message is logged, so you can see what was sent, what failed, and why, and resend anything that did not arrive.

Every feature listed below is included and fully functional. Kelune SMTP stores all data in your own WordPress database and contacts an external service only when you configure a connection for it (see the "External services" section below). Nothing is ever sent to the plugin author.

Kelune SMTP is an independent plugin and is not affiliated with, endorsed by or sponsored by Amazon Web Services, Twilio SendGrid or Mailgun. Amazon SES, Mailgun and SendGrid are trademarks of their respective owners, named here only to identify the services a connection can send through.

== 👇 Helpful Links to Get Started ==

📬 [Contact Us](https://hasthemes.com/contact-us/) | 🛟 [Support Forum](https://wordpress.org/support/plugin/kelune-smtp/) | 🐙 [Source Code](https://github.com/devitemsllc/kelune-smtp)

== ❤️ Features ==

* **Multiple connections** — configure as many senders as you need and keep them side by side.
* **Four providers** — SMTP, Amazon SES, Mailgun, and SendGrid, each with its own credential form.
* **Routing by From address** — every connection owns one sender address, and mail from that address goes out through it.
* **Default and fallback** — a default connection handles everything unrouted, and an optional fallback takes over when the primary fails.
* **Email log** — status, provider, recipients, subject, headers, and the provider's own response for every message.
* **Resend** — send a logged message again, to its original recipients or to different ones.
* **Retention** — prune logged messages automatically after a number of days you choose.
* **Health checks** — a daily check per active connection, plus an on-demand check from the connections screen.
* **Test email** — send a test through any connection from anywhere in the dashboard.
* **Kill switch** — turn routing off and WordPress goes straight back to its own mailer.
* **Encrypted secrets** — provider passwords and API keys are encrypted at rest, and never returned by the REST API.
* **No conflicts with core** — mail is intercepted with the `pre_wp_mail` filter, so `wp_mail()` is never redeclared.

== Installation ==

1. In your WordPress admin, go to **Plugins → Add New**, search for "Kelune SMTP", and click **Install Now**, then **Activate**. To install manually instead, upload the `kelune-smtp` folder to `/wp-content/plugins/` and activate it from the **Plugins** screen.
2. Open **Kelune SMTP** from the admin menu, add a connection for your provider, and send a test email to confirm delivery.

== Source Code ==

The only compiled code in this plugin is the dashboard bundle in `assets/admin/dist/` — one script and one stylesheet; nothing is obfuscated. Its full React and TypeScript source, with the Vite build configuration, is published in a [public GitHub repository](https://github.com/devitemsllc/kelune-smtp), tagged for each release.

To rebuild it (Node.js 20 or newer): `cd assets/admin`, then `npm install` and `npm run build`. The output filenames are fixed, so the build is reproducible and nothing is fetched at runtime.

== Bundled Libraries ==

The scripts in `assets/admin/dist/` are compiled from third-party npm packages — Mantine, TanStack Query, React Router, Recharts, Tabler Icons, Axios and Day.js among them — and none of them is fetched at runtime. React, ReactDOM and `@wordpress/i18n` are not bundled at all; the build maps them to the copies WordPress already ships. Every package is MIT licensed except a handful of indirect ones under ISC, BSD-3-Clause and 0BSD, all of which are compatible with this plugin's "GPLv2 or later" license. `assets/admin/package.json` and `assets/admin/package-lock.json` in the repository linked above name and pin every package, direct and indirect.

No third-party PHP libraries are included.

== Frequently Asked Questions ==

= What PHP version is required? =

PHP 7.4 or higher.

= Does the plugin require any paid or external service to work? =

Kelune SMTP needs a mail service to send through, and that is the one you choose and configure — your own SMTP server, or an Amazon SES, Mailgun or SendGrid account. The plugin itself contacts no service of its own, and nothing is sent to the plugin author. Until you add a connection it stays dormant and WordPress keeps sending mail its usual way.

= Which providers are supported? =

SMTP, Amazon SES, Mailgun, and SendGrid.

= Will this conflict with another SMTP plugin? =

Kelune SMTP hooks the `pre_wp_mail` filter instead of redeclaring the pluggable `wp_mail()` function, so it does not fight plugins that redeclare it. Running two mailer plugins at once is still not a good idea — pick one.

= What happens if a connection stops working? =

If the message fails and you have set a fallback connection, it is retried through the fallback and the log records that it happened. Daily health checks flag a connection that is failing before your visitors notice.

= Where are my credentials stored? =

In your own WordPress database, encrypted at rest with authenticated AES-256-GCM when OpenSSL is available. They are never returned by the REST API — the dashboard only ever sees whether a secret is set.

= Are email bodies stored in the log? =

Only if you leave body logging on. You can turn it off, keep the rest of the log, and set a retention period after which logged messages are deleted automatically.

= Is any functionality locked behind a license? =

No. Everything shipped in this plugin is free and fully functional.

== External Services ==

Kelune SMTP stores all data in your own WordPress database. It connects to an external service only when you create and activate a connection for that service. No data is ever sent to the plugin author.

**SMTP (your own mail server)**
Used to deliver email when you create an SMTP connection. This is not a fixed third-party service: the plugin connects only to the mail server host you enter yourself.
- Data sent: message content, subject, recipient/sender addresses, headers and attachments, plus the SMTP credentials you configure.
- When sent: each time the plugin sends an email through this connection, and when you run a health check or send a test email.
- Service URL: the SMTP host you configure
- Terms / Privacy: governed by your own mail server provider

**Amazon SES**
Used to deliver email when you create an Amazon SES connection and enter AWS credentials. No request is made to Amazon until you have saved that connection.
- Data sent: the raw message — recipient/sender addresses, subject, content and attachments. The health check sends only your AWS credentials and no message data: it reads your account details (sending quota and status) from the `/v2/email/account` endpoint.
- When sent: each time the plugin sends an email through this connection, and when you run a health check or send a test email.
- Service URL: https://email.{your-region}.amazonaws.com/ — for example https://email.us-east-1.amazonaws.com/
- Terms of Service: https://aws.amazon.com/service-terms/
- Privacy Policy: https://aws.amazon.com/privacy/

**Mailgun**
Used to deliver email when you create a Mailgun connection and enter a Mailgun API key and sending domain.
- Data sent: message content, subject, recipient/sender addresses and attachments. The health check sends only your API key and sending domain, to confirm the domain exists on your account via the `/v3/domains/{domain}` endpoint.
- When sent: each time the plugin sends an email through this connection, and when you run a health check or send a test email.
- Service URL: https://api.mailgun.net (or https://api.eu.mailgun.net if you select the EU region)
- Terms of Service: https://www.mailgun.com/legal/terms/
- Privacy Policy: https://www.mailgun.com/legal/privacy-policy/

**SendGrid**
Used to deliver email when you create a SendGrid connection and enter a SendGrid API key.
- Data sent: message content, subject, recipient/sender addresses and attachments. The health check sends only your API key, to read the scopes granted to it from the `/v3/scopes` endpoint.
- When sent: each time the plugin sends an email through this connection, and when you run a health check or send a test email.
- Service URL: https://api.sendgrid.com
- Terms of Service: https://www.twilio.com/en-us/legal/tos
- Privacy Policy: https://www.twilio.com/en-us/legal/privacy

== Screenshots ==

1. Dashboard — sent, failed, total and success rate against the period before it, a daily delivery curve, and the split across your providers.
2. Trends — switch the window to 7, 30 or 90 days; the share ring regroups by provider or by connection.
3. Connections — every sender side by side, each with its provider, status, health and last use.
4. Connection settings — the credential form changes with the provider, and secrets are encrypted at rest.
5. Providers — SMTP for any mail server, plus direct API connections to Amazon SES, Mailgun and SendGrid.
6. Email log — every message with status, recipient, subject, provider and time, filterable and searchable.
7. Message detail — recipients, custom headers, the rendered body in a sandboxed frame, and the provider's own response.
8. Failures — filter down to what did not arrive, then resend one row or the whole selection.
9. Test email — send a test through any connection, as HTML or plain text, and read the provider's reply.
10. Settings — default and fallback connection, log retention, health checks, and a kill switch for routing.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release of Kelune SMTP.
