| 开发者 | nicolasverlhiac |
|---|---|
| 更新时间 | 2026年6月9日 15:15 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
SES_REGION / AWS_REGION, SES_FROM_EMAIL, SES_CONFIG_SET), so the same image ships across environments without touching the database.DISALLOW_FILE_MODS setups and large networks, every setting can be forced from the environment — no database writes at deploy time:
CUSTOM_SMTP_<SETTING> (e.g. CUSTOM_SMTP_MAILER_TYPE=ses_api, CUSTOM_SMTP_HOST, CUSTOM_SMTP_LOG_RETENTION) and it overrides the saved value everywhere. The Amazon SES shortcuts (SES_REGION / AWS_REGION, SES_FROM_EMAIL, SES_CONFIG_SET) keep working too.CUSTOM_SMTP_MAILER_TYPE=ses_api in the container and every site uses Amazon SES, with zero per-site configuration and no custom option_* filter.get_site_option) beneath any per-site option, so one configuration can apply to the whole network.VARIABLE" badge, so admins see exactly what the platform controls.custom-smtp/connection-health — read the current SMTP state (configured, host/port/encryption/auth, log retention) from any tool
custom-smtp/send-test-email — trigger a test email through your configured SMTP servermanage_options) — same security boundary as the wp-admin interfaceCustom SMTP includes presets for popular providers (Gmail, Outlook, AWS SES, SendGrid, etc.). Just select your provider and settings are auto-filled.
Here's a reference list of common SMTP servers: Professional Email Services
Yes! Custom SMTP logs all emails sent from WordPress, including WooCommerce order confirmations, shipping notifications, and customer emails.
Yes, it works with Contact Form 7, WPForms, Gravity Forms, and any plugin that uses WordPress wp_mail() function.
Yes. Custom SMTP is fully stateless-compatible and works on ephemeral infrastructure (Docker, Kubernetes, AWS ECS/Fargate, Google Cloud Run, etc.) without shared storage like EFS or NFS. The plugin stores all data in the WordPress database:
wp_optionsLOGGED_IN_KEY, LOGGED_IN_SALT) are consistent across all instances — the SMTP password encryption depends on them.DISABLE_WP_CRON is set to true, configure an external cron to trigger wp-cron.php so automatic log purge runs properly.Yes. Custom SMTP includes an Amazon SES (API) mailer that authenticates through your AWS IAM role (the ECS task role or EC2 instance role) using the AWS default credential chain. You never enter or store an access key, secret key, or SMTP credential — ideal for stateless, containerized WordPress on AWS ECS/Fargate. In Settings > Custom SMTP, choose "Amazon SES (API · IAM role)" as the mailer, set the region and a verified sender address (or inject them as environment variables), and you're done. You can also provide a SES Configuration Set for bounce/complaint tracking. The following environment variables / PHP constants take priority over the saved settings, so the same container image works across environments:
SES_REGION (falls back to AWS_REGION) — e.g. eu-west-3SES_FROM_EMAIL — the verified sender addressSES_CONFIG_SET — optional SES configuration setYes. Every setting can be forced from a PHP constant or environment variable, which takes priority over the value saved in the database — ideal for immutable Docker images and DISALLOW_FILE_MODS deployments.
Use CUSTOM_SMTP_<SETTING> in uppercase, for example:
CUSTOM_SMTP_MAILER_TYPE — smtp or ses_apiCUSTOM_SMTP_HOST, CUSTOM_SMTP_PORT, CUSTOM_SMTP_SECURE, CUSTOM_SMTP_USERNAME, CUSTOM_SMTP_PASSWORDCUSTOM_SMTP_MAILFROM, CUSTOM_SMTP_FROMNAME, CUSTOM_SMTP_LOG_RETENTIONSES_REGION (or AWS_REGION), SES_FROM_EMAIL, SES_CONFIG_SET.
To switch an entire Multisite network to Amazon SES with no database changes, set in your container: CUSTOM_SMTP_MAILER_TYPE=ses_api, SES_REGION=eu-west-3, SES_FROM_EMAIL=no-reply@example.com.
Values are resolved from PHP constants, then getenv(), $_ENV, and $_SERVER. The $_SERVER source means FrankenPHP (including worker mode) and Bedrock-style stacks work with plain environment variables — no constants required.
On Multisite, the plugin also reads a network-wide option (via get_site_option) beneath any per-site option, so a single configuration can apply to all sites. Fields supplied by the environment are shown read-only in the settings page with a badge naming the source variable. (A password supplied via CUSTOM_SMTP_PASSWORD is used as-is; only stored passwords are encrypted at rest.)
Yes, on WordPress 6.9+. Custom SMTP registers two abilities with the WordPress Abilities API:
custom-smtp/connection-health returns the current SMTP state (configured, host, port, encryption, auth, logging retention) — useful for diagnostics and monitoring.custom-smtp/send-test-email triggers a test email through the configured SMTP server.manage_options), so unprivileged users or scripts cannot invoke them.
$_SERVER, where FrankenPHP (worker mode, where getenv() is unreliable) and Bedrock-style setups expose environment variables reliably — enabling 100% env-var configuration on those stacks without declaring PHP constants. Resolution order: constant → getenv() → $_ENV → $_SERVER. Only the plugin's fixed variable names are read, and client request headers (which land in $_SERVER as HTTP_* keys) cannot spoof them.DISALLOW_FILE_MODS. Use CUSTOM_SMTP_<SETTING> (e.g. CUSTOM_SMTP_MAILER_TYPE, CUSTOM_SMTP_HOST, CUSTOM_SMTP_LOG_RETENTION).mailer_type) is now overridable — set CUSTOM_SMTP_MAILER_TYPE=ses_api to activate Amazon SES across a whole site or network with no per-site configuration and no custom option_* filter.SES_REGION / AWS_REGION, SES_FROM_EMAIL, SES_CONFIG_SET) continue to work and now sit in the same unified override system.VARIABLE" badge so the source is visible.
Multisite
get_site_option) beneath any per-site option, so one configuration can apply to all sites.
Note
CUSTOM_SMTP_PASSWORD are used as-is (not decrypted) — only stored passwords are encrypted at rest.
SES_REGION / AWS_REGION, SES_FROM_EMAIL, SES_CONFIG_SET), overriding the stored settings — so the same image runs across environments.smtp, email, deliverability, mail logger, email logger) to better reflect the plugin's positioning.custom-smtp/connection-health — returns whether SMTP is configured, host, port, encryption mode, auth state, and log retention.custom-smtp/send-test-email — sends a test email through the configured SMTP server.
Changed Defaults
wp_mail_from filter instead of setting From in phpmailer_init (fixes "Invalid address" error).secure options to ensure they are either none, ssl or tls.
None as value.