=== SendForce Mail SMTP Relay — Free WP SMTP & Email API Plugin for Amazon SES, SendGrid, Mailgun, Brevo, Postmark, Zoho ZeptoMail & Gmail === Contributors: shiponkarmakar Donate link: https://profiles.wordpress.org/shiponkarmakar/ Tags: smtp, wp smtp, email log, mailer, email api Requires at least: 5.9 Tested up to: 6.9 Stable tag: 1.0.21 Requires PHP: 7.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Free WP SMTP & email-API plugin. Send via SES, SendGrid, Mailgun, Brevo, Postmark, ZeptoMail, Gmail & more — with logs, queue & alerts. == Description == **SendForce Mail SMTP is a free, open-source WordPress SMTP plugin** that fixes the "WordPress emails not being delivered" problem in minutes. Send WooCommerce order emails, Contact Form 7 / WPForms / Gravity Forms submissions, password resets, registration confirmations, and any other `wp_mail()` traffic through Amazon SES, SendGrid, Mailgun, Brevo (Sendinblue), Postmark, Zoho ZeptoMail, Gmail API, Microsoft 365, or any standard SMTP server — with full email logging, queue, retry, and failure alerts. = Why SendForce Mail SMTP = * **100% Free, no premium upsell.** Every feature you see is included — no "pro version" lock screens, no email-volume cap, no provider unlock paywall. Compare with WP Mail SMTP, Easy WP SMTP, Post SMTP, or FluentSMTP and you'll find SendForce's free tier matches or beats their paid tiers. * **24+ providers, one plugin.** Built-in presets and HTTP API integrations for the most popular transactional email services — pick what fits your budget, deliverability needs, and region. * **Built-in debugging.** Live SMTP debug log on test email, raw API request/response capture in the email log, "Copy Debug Info" button for support tickets, and WP-CLI commands. Designed for developers and agencies who need to diagnose email problems fast. * **Multiple connections with automatic fallback.** Configure a primary connection (e.g. Amazon SES) plus a fallback (e.g. Mailgun). If the primary returns an error, the fallback takes over — no email lost. = Supported email providers = **HTTP API sending (recommended — faster and more reliable than SMTP):** * Amazon SES (AWS Simple Email Service) * SendGrid (by Twilio) * Mailgun (by Sinch) * Brevo (formerly Sendinblue) * SparkPost * Postmark * Zoho ZeptoMail * Microsoft 365 / Outlook (Microsoft Graph API) * Gmail / Google Workspace (Gmail API) * SMTP2GO * SMTP.com * Elastic Email * SocketLabs * Moosend * SendLayer * Mailjet * MailerSend * Mandrill (by Mailchimp) * Resend * Netcore Email API (formerly Pepipost) **SMTP sending (works with any provider, including custom servers):** * Gmail / Google Workspace SMTP (smtp.gmail.com) * Microsoft 365 / Outlook SMTP (smtp.office365.com) * Yahoo Mail SMTP * Zoho Mail SMTP * Turbo SMTP * Any other SMTP server (host, port, username, password) = Features = * **Multiple connections with automatic fallback** — configure a primary connection (e.g. Amazon SES) plus a fallback (e.g. Mailgun, SMTP, or PHP mail). If the primary returns an error, the fallback is attempted automatically. Both attempts are logged so you have a full audit trail; recovered emails carry a "Recovered via fallback" badge in the log detail view. * **Smart Routing Rules** — send different emails through different connections based on rules you define. Match by recipient domain, recipient pattern (glob), sender email or domain, source plugin (auto-detected for WooCommerce, Contact Form 7, WPForms, Gravity Forms, Ninja Forms, Fluent Forms, Forminator, Easy Digital Downloads, MemberPress, LearnDash, MailPoet, BuddyPress, bbPress and more), subject contains, time of day, or weekday. Rules are evaluated top-down (first match wins) and can target a single connection, a round-robin pool, or WordPress phpmail(). Includes inline rule editor, master enable/disable toggle, "Test Routing" tool, and a "via rule:" badge on the Email Log so you can see exactly which rule fired for any send. * **One-click provider presets** — pre-filled host, port, encryption, and API endpoint for every supported provider. Just paste your API key or password. * **Email Log** — every outgoing email logged with status, recipient, subject, headers, error message, and timestamp. Filter by status, search by keyword, filter by date range, export to CSV or JSON. * **Email Queue with retry** — queue mode prevents rate-limit errors and timeouts on bulk sends. Failed emails auto-retry on exponential backoff (5 min → 15 min → 45 min). * **Email Test page** — send a test email with live SMTP debug log output. Diagnose connection problems instantly. * **Failure alerts** — push delivery failures to Telegram, Slack, Discord, Microsoft Teams, Google Chat, Pushover, or any custom webhook. * **Sender Identity override** — force every email to use a custom From name and From address site-wide. * **Conflict detection** — warns you if another SMTP plugin (WP Mail SMTP, FluentSMTP, Easy WP SMTP, Post SMTP, etc.) is active so you can deactivate it before things break. * **Encrypted credential storage** — SMTP passwords and API keys are encrypted at rest using AES-256-CBC with WordPress security salts. * **WP-CLI commands** — `wp sendforce test`, `wp sendforce queue process`, `wp sendforce log list`, `wp sendforce sysinfo`. * **Developer hooks** — `sendforce_before_send`, `sendforce_after_send`, `sendforce_log_entry`, `sendforce_api_request`, `sendforce_api_response` for extending the plugin without forking. * **`WP_DEBUG_LOG` integration** — optional mirroring of SMTP and API debug output to `debug.log`. * **Automatic log cleanup** — configurable retention period (default 30 days). * **Privacy-friendly** — optional disable of email-body logging for GDPR / privacy compliance. * **Multisite compatible.** = Works with all major WordPress plugins = SendForce Mail SMTP hooks into WordPress's core `wp_mail()` function, so it works with **every** plugin that sends email — including WooCommerce, Easy Digital Downloads, Contact Form 7, WPForms, Gravity Forms, Ninja Forms, Fluent Forms, Forminator, MemberPress, LearnDash, BuddyPress, bbPress, MailPoet (transactional), and any custom plugin or theme that uses `wp_mail()`. == Installation == 1. Upload the `sendforce-mail-relay` folder to the `/wp-content/plugins/` directory, or install directly through the WordPress plugin installer. 2. Activate the plugin through the **Plugins** menu in WordPress. 3. Go to **SendForce Mail Relay > Settings** to configure your SMTP server or API credentials. 4. Select your email provider from the provider grid. 5. Enter your credentials and click **Save Settings**. 6. Go to **SendForce Mail Relay > Email Test** and send a test email to verify your configuration. == Frequently Asked Questions == = Do I need an SMTP server or API account? = Yes. You need access to an SMTP server or a transactional email provider account. Most providers (Gmail, Outlook, etc.) offer SMTP access. Transactional services like SendGrid, Mailgun, or Amazon SES offer both SMTP and HTTP API access. = Is my SMTP password or API key stored securely? = Yes. All credentials are encrypted using AES-256-CBC encryption with a key derived from your WordPress security salts before being stored in the database. = What does the email queue do? = When enabled, emails are stored in a database queue instead of being sent immediately. A WP-Cron job processes the queue every 5 minutes, sending emails in batches. Failed emails are retried with exponential backoff (5 min → 15 min → 45 min). = Will SendForce Mail Relay send ALL WordPress emails including WooCommerce? = Yes. SendForce Mail Relay hooks into WordPress's `phpmailer_init` action (SMTP mode) or `pre_wp_mail` filter (API mode). Since every plugin — including WooCommerce, contact form plugins, and membership plugins — sends email via WordPress's `wp_mail()` function, SendForce Mail Relay will handle 100% of outgoing emails. = Will this plugin conflict with other SMTP plugins? = You should only use one SMTP plugin at a time. Please deactivate any other SMTP or email plugins (FluentSMTP, WP Mail SMTP, etc.) before activating SendForce Mail Relay. = What data is logged? = By default, SendForce Mail Relay logs: recipient email, subject, headers, status (sent/failed), error message if any, and timestamp. Email body logging is optional and can be disabled in Settings > Queue & Logging for privacy compliance. = What happens to my data when I uninstall the plugin? = All plugin data (database tables, settings, and scheduled events) is completely removed when you delete the plugin through the WordPress admin. = Does this plugin track me or phone home? = No. SendForce Mail Relay does not collect any data, make any analytics calls, or communicate with any external server except when sending emails through your configured provider. == External Services == SendForce Mail Relay is an email-delivery plugin. It does NOT connect to any external service automatically. A connection is made ONLY after you explicitly configure a provider and either (a) WordPress sends an outgoing email, or (b) you click "Send Test Email", or (c) you enable a notification channel and an email-failure alert is dispatched. For each configured email provider, the data sent on every send is the same set of fields WordPress would otherwise hand to the local mail() function: the recipient address(es), CC, BCC, Reply-To, From name/address, subject, message body, headers, and attachments. No additional telemetry or analytics is transmitted by this plugin. For each configured notification channel (Telegram, Slack, Discord, Microsoft Teams, Google Chat, Pushover, custom Webhook), the data sent is a short status message you compose in the plugin (default: failed-delivery summary or daily summary). = Email-delivery providers (configurable in Settings → Connections) = **SendGrid (by Twilio)** * Service: https://sendgrid.com * When data is sent: every WordPress email when SendGrid is the active connection, plus on test-email click. * Endpoint: https://api.sendgrid.com/v3/mail/send * Privacy Policy: https://www.twilio.com/en-us/legal/privacy * Terms of Service: https://www.twilio.com/en-us/legal/tos **Mailgun (by Sinch)** * Service: https://www.mailgun.com * When data is sent: same as above, but to Mailgun. * Endpoint: https://api.mailgun.net/v3/{domain}/messages (US) or https://api.eu.mailgun.net/v3/{domain}/messages (EU). * Privacy Policy: https://www.mailgun.com/legal/privacy-policy/ * Terms of Service: https://www.mailgun.com/legal/terms/ **Amazon SES (AWS Simple Email Service)** * Service: https://aws.amazon.com/ses/ * When data is sent: same. * Endpoint: https://email.{region}.amazonaws.com/v2/email/outbound-emails (region you select). * Privacy Policy: https://aws.amazon.com/privacy/ * Terms of Service: https://aws.amazon.com/service-terms/ **Brevo (formerly Sendinblue)** * Service: https://www.brevo.com * Endpoint: https://api.brevo.com/v3/smtp/email * Privacy Policy: https://www.brevo.com/legal/privacypolicy/ * Terms of Service: https://www.brevo.com/legal/termsofuse/ **SparkPost** * Service: https://www.sparkpost.com * Endpoint: https://api.sparkpost.com/api/v1/transmissions * Privacy Policy: https://www.sparkpost.com/policies/privacy/ * Terms of Service: https://www.sparkpost.com/policies/tou/ **Postmark** * Service: https://postmarkapp.com * Endpoint: https://api.postmarkapp.com/email * Privacy Policy: https://postmarkapp.com/privacy-policy * Terms of Service: https://postmarkapp.com/terms-of-service **Elastic Email** * Service: https://elasticemail.com * Endpoint: https://api.elasticemail.com/v4/emails * Privacy Policy: https://elasticemail.com/legal/privacy-policy * Terms of Service: https://elasticemail.com/legal/terms-of-use **SMTP2GO** * Service: https://www.smtp2go.com * Endpoint: https://api.smtp2go.com/v3/email/send * Privacy Policy: https://www.smtp2go.com/privacy/ * Terms of Service: https://www.smtp2go.com/terms/ **Netcore Email API (formerly Pepipost)** * Service: https://netcorecloud.com * Endpoint: https://emailapi.netcorecloud.net/v5/mail/send * Privacy Policy: https://netcorecloud.com/privacy-policy * Terms of Service: https://netcorecloud.com (request the latest terms via the contact form on the homepage; Netcore does not publish a stable terms-of-use URL). **SMTP.com** * Service: https://www.smtp.com * Endpoint: https://api.smtp.com/v4/messages * Privacy Policy: https://www.smtp.com/policies/privacy-policy/ * Terms of Service: https://www.smtp.com/legal/terms/ **SocketLabs** * Service: https://www.socketlabs.com * Endpoint: https://inject.socketlabs.com/api/v1/email * Privacy Policy: https://www.socketlabs.com/legal/privacy-policy/ * Terms of Service: https://www.socketlabs.com/legal/ **Moosend (by Sitecore)** * Service: https://moosend.com * Endpoint: https://api.moosend.com/v3/ * Privacy Policy: https://moosend.com/privacy-policy/ * Terms of Service: https://moosend.com/terms/ **SendLayer** * Service: https://sendlayer.com * Endpoint: https://console.sendlayer.com/api/v1/email * Privacy Policy: https://www.sendlayer.com/privacy-policy/ * Terms of Service: https://www.sendlayer.com/terms-of-service/ **Mailjet (by Sinch)** * Service: https://www.mailjet.com * Endpoint: https://api.mailjet.com/v3.1/send * Privacy Policy: https://www.sinch.com/legal/privacy-notice/ * Terms of Service: https://www.sinch.com/legal/terms-of-service/ **MailerSend** * Service: https://www.mailersend.com * Endpoint: https://api.mailersend.com/v1/email * Privacy Policy: https://www.mailersend.com/legal/privacy-policy * Terms of Service: https://www.mailersend.com/legal/terms-of-use **Mandrill (by Mailchimp)** * Service: https://mailchimp.com/developer/transactional/ * Endpoint: https://mandrillapp.com/api/1.0/messages/send.json * Privacy Policy: https://mailchimp.com/legal/privacy/ * Terms of Service: https://mailchimp.com/legal/terms/ **Resend** * Service: https://resend.com * Endpoint: https://api.resend.com/emails * Privacy Policy: https://resend.com/legal/privacy-policy * Terms of Service: https://resend.com/legal/terms-of-service **Zoho ZeptoMail** * Service: https://www.zoho.com/zeptomail/ * Endpoint: https://api.zeptomail.com/v1.1/email * Privacy Policy: https://www.zoho.com/privacy.html * Terms of Service: https://www.zoho.com/zeptomail/terms.html **Microsoft 365 / Outlook (Microsoft Graph API and SMTP)** * Service: https://www.microsoft.com/microsoft-365 * Endpoint (API): https://graph.microsoft.com/v1.0/users/{user}/sendMail (OAuth token from https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token) * Endpoint (SMTP): smtp.office365.com:587 * Privacy Policy: https://privacy.microsoft.com/en-US/privacystatement * Terms of Service: https://www.microsoft.com/en-us/servicesagreement/ **Gmail / Google Workspace (Gmail API and SMTP)** * Service: https://workspace.google.com * Endpoint (API): https://gmail.googleapis.com/gmail/v1/users/me/messages/send (OAuth token from https://oauth2.googleapis.com/token) * Endpoint (SMTP): smtp.gmail.com:587 * Privacy Policy: https://policies.google.com/privacy * Terms of Service: https://policies.google.com/terms = Notification channels (configurable in Settings → Alerts) = These services are contacted ONLY when a notification channel is enabled AND a delivery failure (or daily-summary) event triggers an alert. The data sent is the short status text shown in the plugin's alert preview. **Telegram (Bot API)** * Service: https://telegram.org * When data is sent: when a Telegram channel is enabled, a failed-delivery alert or daily-summary alert is generated. * Endpoint: https://api.telegram.org/bot{token}/sendMessage * Privacy Policy: https://telegram.org/privacy * Terms of Service: https://telegram.org/tos **Pushover** * Service: https://pushover.net * Endpoint: https://api.pushover.net/1/messages.json * Privacy Policy: https://pushover.net/privacy * Terms of Service: https://pushover.net/terms **Slack (Incoming Webhooks)** * Service: https://slack.com * Endpoint: the webhook URL you paste (https://hooks.slack.com/services/...). * Privacy Policy: https://slack.com/trust/privacy/privacy-policy * Terms of Service: https://slack.com/legal **Discord (Webhooks)** * Service: https://discord.com * Endpoint: the webhook URL you paste (https://discord.com/api/webhooks/...). * Privacy Policy: https://discord.com/privacy * Terms of Service: https://discord.com/terms **Microsoft Teams (Incoming Webhooks)** * Service: https://www.microsoft.com/microsoft-teams/ * Endpoint: the Teams webhook URL you paste. * Privacy Policy: https://privacy.microsoft.com/en-US/privacystatement * Terms of Service: https://www.microsoft.com/en-us/servicesagreement/ **Google Chat (Incoming Webhooks)** * Service: https://chat.google.com * Endpoint: the Google Chat webhook URL you paste. * Privacy Policy: https://policies.google.com/privacy * Terms of Service: https://workspace.google.com/terms/premier_terms.html **Custom Webhook** * When data is sent: when a custom Webhook channel is enabled and an alert is generated, a JSON payload is POSTed to the URL you paste. * Endpoint: the URL you paste. * Privacy Policy / Terms: governed by the operator of the URL you provide. = Bundled third-party libraries (no network call) = **Chart.js (https://www.chartjs.org)** — bundled locally at assets/js/chart.umd.min.js (v4.5.0). Used to render the email-stats chart on the dashboard. Loaded entirely from your own server; no CDN call is made. == Privacy Policy == SendForce Mail Relay stores the following data in your WordPress database: * **Email logs** (if logging is enabled): recipient email address, subject, headers, email body (optional), sent status, error messages, and timestamps. * **Email queue** (if queue is enabled): same data as above, plus retry attempt count and next retry time. * **Plugin settings**: your SMTP host, port, username, and encrypted password or API key. Email body logging can be disabled in **Settings > Queue & Logging**. Log entries are automatically deleted after the configured retention period (default: 30 days). All data is deleted when the plugin is uninstalled. We recommend adding a note to your site's privacy policy if you log email content, informing users that outgoing email metadata may be stored. == Screenshots == 1. Modern dashboard with connection status, email statistics, and 7-day send chart. 2. Settings page with visual provider grid and SMTP/API tab switcher. 3. Email Log with status filters, keyword search, and date range filtering. 4. Email Test page with live SMTP debug log output. 5. Email Queue management with retry statistics. == Changelog == = 1.0.21 = * New: **"Clean Now" button on the Email Log**. Run the auto-clean immediately instead of waiting for the next scheduled cron — useful after lowering retention or before exporting logs. Backed by a new `sendforce_cleanup_logs_now` AJAX endpoint (capability + nonce protected) that reports how many rows were removed. * New: **Auto-clean status row above the Email Log table** — at a glance shows the configured retention period, when the next automatic cleanup is scheduled, a deep-link to change the setting, and the "Clean Now" action. * New: **"via rule: