| 开发者 | simmotorlp |
|---|---|
| 更新时间 | 2026年5月8日 17:47 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 6.9.4 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
wp_mail() that routes WordPress email through the Mailtrap Email Sending API instead of SMTP. It is purpose-built for Mailtrap — not a generic SMTP plugin with a Mailtrap preset — so it exposes Mailtrap-native features that SMTP cannot: bulk vs transactional stream routing, email categories, custom variables for tracking, suppression lists, and domain verification status.
Why HTTP API instead of SMTP?
send.api.mailtrap.io for transactional mail and bulk.api.mailtrap.io for bulk mail — automatically, based on category or via filter.wp_remote_post).wp_mail() — works with Contact Form 7, WooCommerce, Gravity Forms, and any plugin that uses WordPress mail.template_uuid.swifttrap_mailtrap_email_category — override the auto-detected email category.swifttrap_mailtrap_use_bulk_stream — force a message into the bulk or transactional stream.swifttrap_mailtrap_template — send via a Mailtrap template by template_uuid.swifttrap_mailtrap_custom_variables — attach tracking metadata to outgoing emails.send.api.mailtrap.io and bulk.api.mailtrap.io. Account stats are fetched from mailtrap.io/api/accounts. See the Mailtrap Privacy Policy. No data is sent anywhere else.
swifttrap-for-mailtrap folder to /wp-content/plugins/.WP Mail SMTP and Post SMTP route through Mailtrap's SMTP gateway and treat Mailtrap as just another SMTP host. SwiftTrap uses Mailtrap's HTTP Send API, which exposes features SMTP cannot: bulk vs transactional stream routing, categories, custom tracking variables, template UUIDs, and live suppression-list visibility. Use SwiftTrap if you want Mailtrap-native behavior; use a generic SMTP plugin if you want a one-config-fits-all-providers setup.
Yes — use the swifttrap_mailtrap_template filter to send via a template_uuid. The template variables can be passed through Mailtrap's standard template-variables payload.
By default, marketing/promotional categories are routed to bulk.api.mailtrap.io and everything else to send.api.mailtrap.io. Override per-message with the swifttrap_mailtrap_use_bulk_stream filter — useful for batch newsletters from a custom plugin.
Log in to mailtrap.io, open your sending domain, go to API Tokens, and create a token with sending permissions.
WordPress falls back to its default wp_mail() handler. No emails are silently dropped.
No. SwiftTrap calls the Mailtrap REST API directly via the WordPress HTTP API. Total plugin size is around 30 KB.
Email data (recipients, subject, body, attachments) goes to send.api.mailtrap.io and bulk.api.mailtrap.io. Account stats are fetched from mailtrap.io/api/accounts. See the Mailtrap Privacy Policy.
Yes — 25 MB per email (matches Mailtrap's API limit).
email/mail/smtp with targeted mailtrap, transactional-email, email-api, wp-mail, email-logswifttrap_mailtrap_template filter for Mailtrap template supportswifttrap_mailtrap_custom_variables filter for email tracking metadataswifttrap_mailtrap_get_account_id() with transient caching