ຄຳອະທິບາຍ
Emerge Mail replaces SMTP plugins for transactional WordPress email. Connect one or more mail accounts and every wp_mail() call your site makes — password resets, comment notifications, WooCommerce receipts, contact-form submissions — is delivered through that account.
Seven providers, one unified send path:
- Gmail (OAuth) — sign in to your Google account; no SMTP password needed.
- Microsoft 365 / Outlook (OAuth) — sign in to personal Outlook/Hotmail/Live or Microsoft 365 work/school accounts.
- SendGrid (API key) — paste a v3 API key with Mail Send permission.
- Mailgun (API key) — paste a private API key, sending domain, and pick your region (US or EU).
- Amazon SES (Sigv4) — paste an IAM access key + secret with
ses:SendEmailpermission. No AWS SDK dependency. - Brevo (API key) — paste a v3 API key.
- Generic SMTP — host + port + encryption + username + password for any SMTP server (your own host, an SES SMTP endpoint, Postmark SMTP, Fastmail, mailcow, etc.).
Because the From address is your own authenticated mailbox or verified sender, messages benefit from SPF, DKIM, and DMARC alignment that PHP’s mail() function cannot provide. This typically results in dramatically better inbox placement than default WordPress mail.
Know exactly what bounced
Most SMTP plugins send and forget. Emerge Mail closes the loop — it captures bounces and spam complaints from your provider and records them right inside WordPress, so you can see which addresses are failing and stop mailing them.
- Real-time bounce & complaint reporting for SendGrid, Mailgun, Brevo, and Amazon SES. Paste one webhook URL into your provider’s dashboard — Emerge Mail auto-detects which provider sent each event from its payload, so a single endpoint covers them all.
- Gmail bounces too. Gmail can’t push webhooks, so Emerge Mail ships a small Google Apps Script that reads “Mail Delivery Subsystem” messages from your mailbox and forwards them to the same endpoint. Setup takes about a minute and installs its own schedule.
- Classified automatically as a hard bounce, soft bounce, or spam complaint, written to the Activity Log, and correlated back to the original message — recipient, subject, mailbox, and From all in one place.
- Built for developers. Every bounce fires an
emerge_mail_bounce_receivedaction with a clean, uniform payload, so list-hygiene, auto-suppression, or CRM-sync code can react instantly. Set anX-Emerge-Mail-Refheader on a send and it’s echoed straight back to you on the bounce — on any provider, whether the bounce arrived synchronously at send time or later by webhook.
Key features
- Seven providers (above), all sharing the same routing, failover, and From-email overrides.
- Multiple connections per site with automatic failover. The Active connection sends first; if it fails, the next available connection is tried, with a 1-hour cooldown on failed connections. Mix-and-match across providers — e.g. SendGrid primary, an SMTP fallback, and a Gmail mailbox as the last-resort backup.
- Optional connection throttle: rotate through all your connected accounts instead of hammering the Active one.
- Per-connection From email override for verified send-as aliases / verified senders.
- Configurable sender defaults: a custom From name and an opt-in “Reply-To = admin email when sender differs” setting.
- Full
wp_mailcompatibility: To/Cc/Bcc (including from headers), HTML bodies, multipart alternative, attachments, custom headers, RFC 2822 address formats including comma-separated lists and quoted display names, non-UTF-8 charsets. - RFC 2047 encoding for non-ASCII subjects and display names.
- One-click Send test button per connection.
- Email Controls page: opt-in suppression of WordPress core self-notifications you don’t want to receive (comment moderation, automatic updates, new-user registered, etc.) — recorded to the Activity Log instead.
- Bounce & complaint tracking across Gmail, SendGrid, Mailgun, Amazon SES, and Brevo — captured in real time via a single auto-detecting webhook (plus a Gmail Apps Script bridge), classified hard / soft / complaint, correlated to the original send, and exposed to your own code through the
emerge_mail_bounce_receivedaction. - Activity Log page: unified record of mail sent through your connections, suppressed notifications, provider send errors, and recipient bounces — with provider, type, and severity filters, Provider / Mailbox / From / Recipient columns, bulk delete, and automatic 10-day pruning.
- Bounce classification: provider-specific error patterns map to a unified
send.bounce.*/send.error.*taxonomy so per-recipient bounces are distinguished from transport outages across every provider. - Last-error visibility per connection and a site-wide admin notice on recent failures.
- Automatic hourly token refresh for OAuth connections (Action Scheduler when available, WP-Cron fallback). API-key connections require no maintenance.
- Safe fallback to default WordPress mail delivery on any failure — the plugin never blocks email.
- Extensible via filters: cooldown, HTTP timeouts, token-refresh timing, MIME output, suppression catalog.
How it works
When you connect an account, the credentials (OAuth tokens, or your API key / SMTP password) are encrypted with a per-site key and stored as a WordPress option. From that point on, your site talks directly to the provider’s API or SMTP endpoint; no third party sits in the send path.
The plugin hooks pre_wp_mail. If at least one connection is active, the message is routed through it. If the provider returns an error — or if no connections are configured — WordPress’s default mail delivery takes over transparently.
What this is not
- Not a marketing or bulk email tool. No subscriber lists, no campaigns, no broadcasts.
- Not a shared-IP SMTP relay. Each site sends from its own connected accounts.
- Not a way to spoof arbitrary From addresses. The provider will reject anything that isn’t an authorized sender on the connected account.
External services
To deliver mail, Emerge Mail can communicate with up to eight external services depending on which providers you connect. By installing and using this plugin you agree to use of these services. Nothing is contacted until you connect at least one provider in the plugin settings — every external call below is gated on the corresponding connection existing.
1. Emerge OAuth service (emerge.redigit.net)
What it is and what it’s used for: A stateless OAuth proxy operated by the plugin author. It exists to broker the OAuth authorization handshake between your WordPress site and Google or Microsoft so the plugin can be authorized to send mail from your mailbox. The proxy holds the OAuth client secrets that Google and Microsoft would otherwise require every site to register individually.
What data is sent, when:
- When you click Connect Gmail or Connect Microsoft, your browser is redirected to
https://emerge.redigit.net/oauth/{provider}/authorizewith a PKCE code challenge and a state token generated by your site. No personal data is sent. - When the provider redirects back, your site posts the authorization code and PKCE verifier to
https://emerge.redigit.net/oauth/{provider}/tokento receive the access and refresh tokens. The tokens are returned directly to your site and stored locally, encrypted, inwp_options. The proxy does not persist them. - When an access token nears expiry, your site posts the refresh token to
https://emerge.redigit.net/oauth/{provider}/refreshto obtain a new access token. Again, nothing is persisted on the proxy. - No email content, recipient lists, or message metadata is ever sent to the proxy.
Terms and privacy:
- Terms of Service: https://emerge.redigit.net/terms-of-service
- Privacy Policy: https://emerge.redigit.net/privacy-policy
2. Google APIs (Gmail)
What it is and what it’s used for: Used only when you connect a Gmail mailbox. Once authorized, the plugin sends every wp_mail() message directly to the Gmail API (gmail.googleapis.com) from your WordPress site. Periodically the plugin also calls the Google OAuth userinfo endpoint (www.googleapis.com/oauth2/v2/userinfo) to verify the access token is still valid.
What data is sent, when:
- On each
wp_mail()call routed through a Gmail connection: the full outbound message (To/Cc/Bcc, subject, body, attachments, custom headers) is POSTed tohttps://gmail.googleapis.com/gmail/v1/users/me/messages/sendas a base64-encoded RFC822 message. This is what’s required for the message to reach the recipient. - On token validation: a Bearer token is sent to
https://www.googleapis.com/oauth2/v2/userinfo. No message data is included.
Terms and privacy:
- Google Terms of Service: https://policies.google.com/terms
- Google Privacy Policy: https://policies.google.com/privacy
- Google API Services User Data Policy: https://developers.google.com/terms/api-services-user-data-policy
3. Microsoft Graph (Outlook / Microsoft 365)
What it is and what it’s used for: Used only when you connect a Microsoft mailbox. Once authorized, the plugin sends every wp_mail() message directly to Microsoft Graph (graph.microsoft.com) from your WordPress site. Periodically the plugin also calls Graph’s /me endpoint to verify the access token is still valid.
What data is sent, when:
- On each
wp_mail()call routed through a Microsoft connection: the full outbound message (To/Cc/Bcc, subject, body, attachments, custom headers) is POSTed tohttps://graph.microsoft.com/v1.0/me/sendMailas a JSON payload. This is what’s required for the message to reach the recipient. - On token validation: a Bearer token is sent to
https://graph.microsoft.com/v1.0/me. No message data is included.
Terms and privacy:
- Microsoft Services Agreement: https://www.microsoft.com/en/servicesagreement
- Microsoft Privacy Statement: https://privacy.microsoft.com/en-us/privacystatement
4. SendGrid (api.sendgrid.com)
What it is and what it’s used for: Used only when you add a SendGrid connection. The plugin sends every wp_mail() message routed through that connection directly to the SendGrid Mail Send API. The connect-time validation also calls SendGrid’s /v3/user/profile to confirm the API key works.
What data is sent, when:
- On each
wp_mail()call routed through a SendGrid connection: the outbound message (recipients, subject, body, attachments, custom headers) is POSTed tohttps://api.sendgrid.com/v3/mail/sendas a JSON payload. - On connect: an authenticated GET is sent to
https://api.sendgrid.com/v3/user/profileto validate the API key. No message data is included.
Terms and privacy:
- SendGrid Terms: https://www.twilio.com/legal/tos
- SendGrid Privacy Statement: https://www.twilio.com/legal/privacy
5. Mailgun (api.mailgun.net or api.eu.mailgun.net)
What it is and what it’s used for: Used only when you add a Mailgun connection. The plugin sends every wp_mail() message routed through that connection directly to the Mailgun Messages API on the region (US or EU) you select at connect time.
What data is sent, when:
- On each
wp_mail()call routed through a Mailgun connection: the outbound message (recipients, subject, body, attachments, custom headers) is POSTed as multipart/form-data tohttps://api.mailgun.net/v3/{your-domain}/messages(or the EU equivalent). - On connect: an authenticated GET is sent to
/v3/domains/{your-domain}to validate the API key + domain pairing. No message data is included.
Terms and privacy:
- Mailgun Terms of Service: https://www.mailgun.com/legal/terms/
- Mailgun Privacy Policy: https://www.mailgun.com/legal/privacy-policy/
6. Amazon SES (email.{region}.amazonaws.com)
What it is and what it’s used for: Used only when you add an Amazon SES connection. The plugin sends every wp_mail() message routed through that connection directly to the SES v2 SendEmail API in the AWS region you select at connect time. Requests are signed with AWS Signature V4 using the IAM credentials you provided.
What data is sent, when:
- On each
wp_mail()call routed through a SES connection: the outbound message (recipients, subject, body, custom headers) is POSTed tohttps://email.{region}.amazonaws.com/v2/email/outbound-emailsas a JSON payload. - On connect: a signed GET is sent to
/v2/email/accountin the same region to validate the credentials. No message data is included. - If you enable bounce handling for SES: when Amazon SNS posts its one-time subscription confirmation to your site’s webhook endpoint, the plugin completes the handshake by sending a GET to the
SubscribeURLthat Amazon includes (validated to only ever requestamazonaws.comhosts). No message data is included. Thereafter SNS posts bounce/complaint notifications to your endpoint; the plugin does not initiate those.
Terms and privacy:
- AWS Customer Agreement: https://aws.amazon.com/agreement/
- AWS Privacy Notice: https://aws.amazon.com/privacy/
7. Brevo (api.brevo.com)
What it is and what it’s used for: Used only when you add a Brevo connection. The plugin sends every wp_mail() message routed through that connection directly to the Brevo Transactional Email API.
What data is sent, when:
- On each
wp_mail()call routed through a Brevo connection: the outbound message (recipients, subject, body, attachments, custom headers) is POSTed tohttps://api.brevo.com/v3/smtp/emailas a JSON payload. - On connect: an authenticated GET is sent to
https://api.brevo.com/v3/accountto validate the API key. No message data is included.
Terms and privacy:
- Brevo Terms of Use: https://www.brevo.com/legal/termsofuse/
- Brevo Privacy Policy: https://www.brevo.com/legal/privacypolicy/
8. Your own SMTP server (Generic SMTP)
What it is and what it’s used for: Used only when you add a Generic SMTP connection. The plugin opens an SMTP connection to whatever host:port you specify, authenticates with the username and password you provide, and sends wp_mail() messages via SMTP. WordPress’s bundled PHPMailer library handles the SMTP protocol.
What data is sent, when:
- On each
wp_mail()call routed through this connection: the outbound message (recipients, subject, body, attachments, custom headers) is transmitted over SMTP to your configured host. - On connect: PHPMailer opens the SMTP connection, runs EHLO + STARTTLS (if enabled), and authenticates — no message is sent.
Terms and privacy: Determined by whichever SMTP server you choose to connect to. This plugin does not introduce any third-party SMTP relay; you control the destination.
ການຕິດຕັ້ງ
- Upload the
emerge-mailfolder to/wp-content/plugins/, or install via the Plugins screen. - Activate the plugin from the Plugins menu.
- Click the new Emerge Mail top-level item in your WordPress admin sidebar.
- Pick a provider and connect:
- Gmail / Microsoft — click Connect Gmail or Connect Microsoft and approve the OAuth consent screen.
- SendGrid / Brevo — paste an API key with Mail Send permission and a verified From email.
- Mailgun — paste your private API key, a verified sending domain, and pick your region (US or EU).
- Amazon SES — paste an IAM access key + secret with
ses:SendEmailpermission and the region your SES identity is verified in. - Generic SMTP — paste host, port, encryption, username, and password.
- Click Send test on the new connection row to confirm delivery to your administrator email.
As soon as a connection is active, wp_mail() routes through it automatically.
ຄຳຖາມທີ່ພົບເລື້ອຍ
-
Does this work with WooCommerce, Contact Form 7, WPForms, etc.?
-
Yes. Anything that uses
wp_mail()— which is virtually every WordPress plugin that sends email — works without modification. -
Do I need a Google Cloud or Microsoft Azure account?
-
No. Authorization is handled by the Emerge OAuth service. You sign in with your normal Google or Microsoft account; no developer setup is required.
-
How are my credentials stored?
-
All credentials — OAuth tokens for Gmail and Microsoft, plus API keys and SMTP passwords for SendGrid, Mailgun, Amazon SES, Brevo, and Generic SMTP — are encrypted with a key generated locally on your site on first activation and stored as a WordPress option. They never leave your install. For OAuth, the proxy used during sign-in does not persist tokens.
-
What happens when an OAuth access token expires?
-
Access tokens expire roughly hourly. The plugin refreshes them automatically — both on a schedule and inline if a send happens to coincide with an expiry. You don’t need to do anything. API-key connections (SendGrid, Mailgun, SES, Brevo, SMTP) don’t expire — the credentials you paste are used as-is until you rotate them yourself.
-
What happens if a provider is unreachable?
-
The plugin returns an error from its
pre_wp_mailhook, which causes WordPress to fall back to its default mail delivery (or to the next available connection if you have failover set up). The failure is recorded in the Last error column of the settings page and surfaced as an admin notice for 24 hours. -
Can I send from multiple accounts?
-
Yes. Connect as many as you like, mixing providers freely — e.g. a SendGrid account, a Gmail mailbox, and an SMTP server as a last-resort fallback. The connection marked Active is used first. If a send fails (or the Active connection is in cooldown after a recent error), the plugin automatically falls through to the next available connection. You can switch the Active account at any time from the Connections table.
For high-volume sites, turn on Throttle connections in Sender settings to spread sends across all connected accounts instead of always hitting the Active one.
-
Can I override the From email?
-
Yes. Enter a different address in the From email column on the Connections table. It must be a sender that the provider has authorized for this account — a verified send-as alias for Gmail/Microsoft, a verified sender or domain for SendGrid / Mailgun / Amazon SES / Brevo, or whatever the SMTP server allows. Sends from an unauthorized address will be rejected by the provider.
-
Can I customize the From display name?
-
Yes. Set it in Sender settings From name on the main settings page. Leave it blank to use your site title as the default.
-
Does Emerge Mail track bounces and spam complaints?
-
Yes. Open Emerge Mail Email Settings Bounce handling. For SendGrid, Mailgun, Brevo, and Amazon SES, copy the single webhook URL into your provider’s event/webhook settings (SES routes through an SNS topic subscription, which confirms itself automatically). One endpoint serves every provider — Emerge Mail detects which one sent each event from the payload. For Gmail, copy the included Google Apps Script into a new project at script.google.com and run its setup function once; it reads delivery-failure messages from the mailbox and forwards them to the same endpoint on a 15-minute schedule. Every bounce or complaint is classified (hard / soft / complaint) and recorded in the Activity Log, correlated back to the original message.
-
How do I act on a bounce from my own plugin or code?
-
Hook the
emerge_mail_bounce_receivedaction. It fires once per bounce or complaint — whether detected synchronously when the provider rejects a recipient at send time, or later via webhook — with a single, uniform payload:email,disposition(hard/soft/complaint),type,subject,mailbox,from,provider,reason,message_id,client_ref, andsource. To tie a bounce back to your own records, set anX-Emerge-Mail-Refheader on the originalwp_mail()call — its value is echoed back to you asclient_ref, on every provider. -
Can I suppress noisy WordPress notifications I don’t care about?
-
Yes. Open Emerge Mail Email Controls and tick the notifications you want stopped. Eight WordPress core admin/editor notifications are listed (comment moderation, new comments, password reset notices, new user registrations, and automatic-update results). Suppressed notifications are recorded in Emerge Mail Activity Log so you still have an audit trail. End-user notifications (password resets, account changes, new-user welcome) are intentionally not listed — users need those.
-
Does the plugin read my mailbox?
-
No. For Gmail and Microsoft, the OAuth scope requested is sufficient only to send mail. The plugin does not call any read endpoints and cannot access existing messages. For SendGrid, Mailgun, SES, Brevo, and SMTP, the plugin only ever posts outbound messages — it does not request inbox reads, contact-list reads, or any other data from the provider.
-
Is `wp_mail` still available to other plugins after activation?
-
Yes.
wp_mailcontinues to function normally. The plugin only changes how the underlying send is performed; it doesn’t change any ofwp_mail‘s public behavior. -
Will the plugin work without an active mailbox connection?
-
Yes.
wp_mailfalls through to WordPress’s default delivery when no connection is available. The plugin never blocks email. -
How do I remove all stored data on uninstall?
-
Deleting the plugin from the Plugins screen runs
uninstall.php, which removes every stored connection, all encrypted tokens, the per-site encryption key, sender/control settings, the bounce-webhook secret, the Activity Log table, and all scheduled jobs.
ການຣີວິວ
ຜູ້ຮ່ວມພັດທະນາ ແລະ ຜູ້ພັດທະນາ
“Emerge Mail” ແມ່ນຊອຟແວໂອເພັນຊອດ (Open Source). ບຸກຄົນຕໍ່ໄປນີ້ໄດ້ມີສ່ວນຮ່ວມໃນການພັດທະນາປລັກອິນນີ້.
ຜູ້ຮ່ວມພັດທະນາແປ “Emerge Mail” ເປັນພາສາຂອງເຈົ້າ.
ສົນໃຈຮ່ວມພັດທະນາບໍ່?
ເບິ່ງລະຫັດ, ກວດເບິ່ງ ຄັງເກັບ SVN, ຫຼື ຕິດຕາມ ບັນທຶກການພັດທະນາ ຜ່ານ RSS.
ບັນທຶກການປ່ຽນແປງ
1.5.0
- New: bounce & complaint tracking for SendGrid, Mailgun, Brevo, Amazon SES, and Gmail. A single REST endpoint detects the source from the payload, classifies each event as a hard/soft bounce or complaint, records it in the Activity Log (correlated to the original send), and fires the
emerge_mail_bounce_receivedaction. Copy the URL from Email Settings Bounce handling into your provider’s dashboard (SES routes through an SNS topic subscription, confirmed automatically). Gmail, which can’t push webhooks, uses a provided Google Apps Script that reads bounce messages from the mailbox and forwards them to the same endpoint. - New: successful sends store the provider’s message id on the log row (not shown as a column) so webhook bounces can map back to the send. Adds a 4th argument to the
emerge_mail_after_send_attemptaction. - New:
emerge_mail_bounce_receivedfires for synchronous (send-time) rejections as well as async webhooks, with one unified payload — recipient, disposition, type, subject, mailbox, From, provider, reason, andclient_ref. Set anX-Emerge-Mail-Ref(orMessage-ID) header on wp_mail() and it’s echoed back asclient_refso you can map a bounce to your own record on any provider. - Changed: “Email Controls” is now “Email Settings”; suppression checkboxes sit under a single “Suppress WordPress Admin notifications” heading.
- Changed: the daily usage report derives its counts from the Activity Log instead of a separate counter option (
emerge_usage_counters), which is removed. Same data, same cadence. - Changed: stored options and scheduled jobs renamed from the bare
emerge_prefix toemerge_mail_(encryption key, connections, settings, webhook secret, cron hooks) to avoid namespace clashes with other plugins. Renamed in place on upgrade — no settings or connections lost.
1.4.0
- New: Activity Log unifies all mail activity — successful sends logged alongside suppressions, send errors, and bounces, with Provider/Mailbox/From columns and a provider filter.
- New:
emerge_mail_log_sendsfilter to disable logging of successful sends. - New: Reconnect on an Expired API-key connection re-validates the saved key in place and reactivates it if valid.
- Changed: “Bulk sending” renamed to “Throttle connections” — rotates across all mailboxes when on; burst detection removed.
- Changed: post-error connection cooldown raised from 10 minutes to 1 hour.
- Changed: default log retention lowered from 30 days to 10 days (
emerge_mail_log_retention_days). - Changed: send-error/bounce logging and the bounce classifier are now standard; the
EMERGE_MAIL_PROgate is removed. - Fix: a successful send (including Send test) clears a stuck “Expired” status back to “Active”.
- Fix: the dashboard failure notice names the provider and auth type, so failures are unambiguous when connections share an email.
- Removed: the unsafe “Other admin notices” catch-all in Email Controls (it could suppress admin password resets).
1.3.0
- New: SendGrid, Mailgun, Amazon SES (Sigv4, no AWS SDK), Brevo, and Generic SMTP (PHPMailer) providers.
- New: per-provider connect forms — credentials are validated against the provider before being persisted.
- Changed: failover and throttle mix-and-match freely across OAuth and API-key providers.
- Changed: bounce classifier extended with provider-specific patterns for all five new providers.
- Changed: token-refresh scheduler skips API-key connections; they’re marked
expiredon 401/403.
1.2.0
- New: Status column on the connections list (Active / Cooldown / Expired).
- New: Reconnect action on expired connections — re-runs OAuth and upserts tokens in place.
- Fix: settings form “link expired” error on sites also running Emerge Campaigns; admin handlers are now page-scoped.
- Changed: form-submit triggers and nonce actions renamed from
emerge_*toemerge_mail_*to avoid collisions.
1.1.0
- New: “Other admin notices” catch-all suppression in Email Controls (
emerge_mail_suppress_other_adminfilter). - New: unified Activity Log replaces the Suppression Log (suppressions, send errors, bounces in one table).
- New (pro): synchronous bounce detection and provider send-error logging (
send.bounce.*/send.error.*). - New:
emerge_mail_event_loggedandemerge_mail_after_send_attemptactions; pro gate viaEMERGE_MAIL_PRO. - Changed:
wp_mail()return reflects failure type — transport errors fall back to default mail, recipient bounces returnfalse(emerge_mail_fallback_on_failurefilter). - Changed: connection-failure admin notice scoped to Dashboard and Plugins screens.
- Schema:
emerge_suppression_logrenamed toemerge_mail_event_logwith new columns; migrated in place.
1.0.0
- Initial release.
- OAuth connections to Gmail and all Microsoft account types.
- Multiple mailboxes with active-first routing, automatic failover, and per-connection cooldown.
- Optional throttle that rotates connections, per-connection From override, configurable Sender settings.
- Full
wp_mailmapping (attachments, Cc/Bcc, multipart, address lists, non-UTF-8, RFC 2047). - Send-test per connection; Email Controls page; Suppression Log with 30-day pruning.
- Hourly token maintenance (Action Scheduler / WP-Cron); safe fallback to default mail.
- Filter hooks for cooldown, HTTP timeouts, token refresh, MIME output, suppression catalog, and log retention.
