| 开发者 | saraltechies |
|---|---|
| 更新时间 | 2026年10月21日 22:47 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
mail(), which has no authentication, so a lot of it goes to spam or is never delivered. Saral SMTP sends every wp_mail() email through a proper email service instead, using the service's own API where it has one. Plugins and themes that send email need no changes.
Most SMTP plugins stop there: one service for every email, and a generic "check your SPF and DKIM" warning. Saral SMTP is built for sites where email matters enough to get those two things right.
Route by sender
A shop's order emails, a contact form's messages and WordPress's password resets have different needs. Saral SMTP knows which plugin, theme or WordPress feature sent each email, so you can send each sender's emails through its own connection: WooCommerce orders through Amazon SES, contact form messages through your Google Workspace mailbox, everything else through Brevo. The fallback connection still covers all of them, and the email log shows why each email went through the connection it did.
A deliverability check that knows your email service
Since 2024 Gmail, Yahoo and Microsoft reject or junk email from domains without SPF, DKIM and DMARC, and every email service needs different records. Choose a connection and Saral SMTP checks the records that service needs: the SPF include it requires (merged into your existing SPF record, ready to copy), the DKIM selectors it signs with, MailChannels' Domain Lockdown, and DMARC. For Amazon SES it asks SES for your domain's three DKIM keys and tells you exactly which CNAME records are missing. "Other SMTP" connections are recognized by their server, so smtp.office365.com is checked as Microsoft 365.
Supported email services
wp_mail() functions.wp saral-smtp test, connections, stats, purge-logs and retry-failed.saralsmtp_providers: register your own provider by extending SaralSMTP_Provider.saralsmtp_default_connection: choose a connection programmatically.saralsmtp_before_send, saralsmtp_mail_sent, saralsmtp_mail_failed: actions around every send.saralsmtp_pre_send: change an email just before it is sent, or stop it (return true or false).saralsmtp_logged: runs after an email is logged, with the log id, status and the service's message id.saralsmtp_stored_settings, saralsmtp_stored_connections: supply settings and connections, e.g. one setup for a multisite network.saralsmtp_nav_pages, saralsmtp_log_row_status, saralsmtp_log_view: add pages to the Saral SMTP menu and details to the email log.saralsmtp_http_timeout, saralsmtp_smtp_timeout, saralsmtp_dkim_selectors.SARALSMTP_ENCRYPTION_KEY in wp-config.php to use your own encryption key instead of the site's salts.saral-smtp folder to /wp-content/plugins/, or install it from Plugins → Add New.Saral SMTP records which plugin, theme or WordPress feature called wp_mail() for every email (you can see it in the email log). Under Settings → Route by sender, choose a connection for any of them. An email follows the first rule that matches: a connection chosen for a test or resend, then the rule for its sender, then a connection whose From address matches, then the default connection. If that connection fails, the fallback connection takes over. Retries and resends follow the same rules as the original email.
Each email service authorizes your domain differently. Brevo needs include:spf.brevo.com in SPF and DKIM keys at brevo1 and brevo2; Amazon SES needs three DKIM keys that are unique to your domain and no SPF change; Resend needs SPF on a send. subdomain. Knowing the service lets Saral SMTP check the right records and give you the exact ones to add, instead of a generic warning. Without a connection, it runs a general check.
For a business domain, an API service such as Amazon SES, Brevo, Postmark, Resend or SendGrid is usually the most reliable. If you already use Google Workspace or Microsoft 365, the Gmail or Microsoft 365 connection is the easiest. If your host blocks outgoing SMTP ports, choose any API-based service.
No. Saral SMTP handles every email sent with wp_mail(), which is what almost all plugins and themes use.
If the connection chosen for an email fails, Saral SMTP sends the same email through the fallback connection straight away. The log shows that the fallback was used and why the first connection failed.
Run Tools → Domain deliverability check. Your domain needs an SPF record that includes your email service, the DKIM records your service gives you, and a DMARC record. Use a From address on that domain.
They are encrypted with AES-256 before they are stored, using a key derived from your site's salts (or SARALSMTP_ENCRYPTION_KEY if you define it). Saved secrets are never sent back to the browser. If you change your salts, enter the keys again.
Yes. Turn on Settings → Disable all email sending. Emails are still logged, so you can check them.
Connections, settings and logs are kept unless you turn on Settings → Delete all Saral SMTP data when the plugin is deleted.
Each site in a network has its own connections and log.
saralsmtp_pre_send, saralsmtp_logged, saralsmtp_stored_settings, saralsmtp_stored_connections, saralsmtp_nav_pages, saralsmtp_log_row_status and saralsmtp_log_view.