For developers who need more than the built-in providers, the SMTP Integration Add On offers a filter to add your own email provider or remove one from the list. The Add On also works with the standard WordPress mail hooks, so existing sender and content type customizations keep working.
Filters
pmpro_smtp_connectors
Filters the list of available email providers (connectors). Use this to register your own connector or remove one from the provider list on the Connection tab. The list is built once per page load.
apply_filters( 'pmpro_smtp_connectors', array $connectors );
Parameters
$connectors: array; Connector objects that extendPMPRO_SMTP_Connector_Base, keyed by slug. The default slugs aregeneric(Custom SMTP),sendgrid,mailgun,postmark,brevo,resend, andmailersend.
For example, this code removes SendGrid from the provider list:
function my_pmpro_smtp_remove_sendgrid( $connectors ) {
unset( $connectors['sendgrid'] );
return $connectors;
}
add_filter( 'pmpro_smtp_connectors', 'my_pmpro_smtp_remove_sendgrid' );
If you remove the provider that is currently selected, the Add On stops handling email and WordPress falls back to its default mailer.
Build a Custom Connector
To add a provider, create a class that extends PMPRO_SMTP_Connector_Base and add an instance of it to the array in the pmpro_smtp_connectors filter. The base class loads on the plugins_loaded hook, so declare your class after that (for example, on plugins_loaded at a priority later than 10, or inside your filter callback).
Your class must implement these methods:
get_name(): Returns the connector’s unique slug. Use the same value as the array key you register it under. Thegenericslug is reserved for Custom SMTP.get_title(): Returns the name shown in the provider list and on the Test Email tab.get_settings_fields(): Returns an array of fields to show when the provider is selected. Each field is an array with akey,label, andtype(text,password,number,select, orcheckbox), plus optionaloptions(for select fields),desc,placeholder, andsensitive. Setsensitivetotrueon API keys and passwords so the value is stored exactly as entered and masked on screen.send( array $atts ): Sends one email and returnstrueon success or aWP_Erroron failure.$attsholds theto,subject,message,headers, andattachmentspassed towp_mail().
You can also override get_description() to show a short description above your provider’s fields.
Saved field values are stored in the pmpro_smtp_connector_{slug} option. Read them in your class with $this->get_setting( $key, $default ). The base class also includes helpers for common tasks, such as resolve_from() to get the From name and address the same way the built-in providers do.
If your provider’s API accepts custom message headers, call $this->get_list_unsubscribe_headers( $headers ) from your send() method to get the List-Unsubscribe and List-Unsubscribe-Post headers from a message, so email apps can show an unsubscribe button. The method is protected, so only your connector class can call it. Pass it the array that the base class’s parse_headers() method returns for $atts['headers']. It returns an array of header name to value, which is empty when the message has neither header. Add the values to your API request in the format your provider expects. The built-in Postmark, SendGrid, Mailgun, and Resend connectors do this. Brevo and MailerSend don’t.
Once registered, your connector appears in the provider list and the Backup Provider dropdown. The Add On calls its send() method for every outgoing email, tries the backup provider if it returns a WP_Error, and records the result in the Paid Memberships Pro email log.
WordPress Mail Hooks
The Add On uses these standard WordPress hooks. Customizations you already apply with them continue to work with every provider.
wp_mail_fromandwp_mail_from_name: Applied to set the sender for API providers when the message doesn’t include a From header, the same way WordPress does for its own mailer.wp_mail_content_type: Checked by API providers to decide whether to send a message as HTML when it doesn’t include a Content-Type header.wp_mail_succeededandwp_mail_failed: Fired after an API provider sends or fails, so plugins that listen for these actions (including the Paid Memberships Pro email log) still run. Neither action fires for emails discarded by sandbox mode.pre_wp_mail: Used by API providers and sandbox mode to take over sending. If another plugin already handled the email on this filter, the Add On leaves it alone to avoid sending it twice.phpmailer_init: Used to apply your Custom SMTP settings to WordPress’s built-in mailer.
Get Support From Our Team of Experts
Have a question about how to use this feature? Our Support Page outlines three ways to get support.
Our Max plans include hands-on help customizing your membership site and implementing new features. Upgrade to PMPro Max now »
Last updated on November 19, 2026