Gmail SMTP 1.2.3.24 has 4 actions and 8 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Gmail SMTP fires an action
add_action( 'wp_mail_failed', function( $error ) {
// Your code runs here.
}, 10, 1 );
// Change a value Gmail SMTP is about to use
add_filter( 'wp_mail_charset', function( $charset ) {
// Change $charset here.
return $charset;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
wp_mail_failed
action/** * This filter is documented in wp-includes/pluggable.php */ do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_error_data ) ); -
phpmailer_init
action/** * Fires after PHPMailer is initialized. */ do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) ); -
wp_mail_charset
filter/** * Filters the default wp_mail() charset. */ apply_filters( 'wp_mail_charset', $charset ); -
wp_mail_content_type
filter/** * Filters the wp_mail() content type. */ apply_filters( 'wp_mail_content_type', $content_type ); -
wp_mail_embed_args
filter/** * Filters the arguments for PHPMailer's addEmbeddedImage() method. */ apply_filters( 'wp_mail_embed_args', array( 'path' => $embed_path, 'cid' => (string) $key, 'name' => basename( $embed_path ), 'encoding' => 'base64', 'type' => '', 'disposition' => 'inline', ) ); -
wp_mail_from
filter/** * Filters the email address to send from. */ apply_filters( 'wp_mail_from', $from_email ); -
wp_mail_from_name
filter/** * Filters the name to associate with the "from" email address. */ apply_filters( 'wp_mail_from_name', $from_name ); -
wp_mail_succeeded
action/** * Fires after PHPMailer has successfully sent an email. */ do_action( 'wp_mail_succeeded', $mail_data ); -
apply_filters( 'gmail_smtp_advanced_settings_fields', $settings_fields ); -
do_action( 'gmail_smtp_advanced_settings_submitted', $post ); -
gmailsmtp_cc
filterapply_filters( 'gmailsmtp_cc', $gmailsmtp_cc ); -
gmailsmtp_reply_to
filterapply_filters( 'gmailsmtp_reply_to', $gmailsmtp_reply_to );
Generated from Gmail SMTP's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Can't find the right hook?
We can build the customisation for you. Describe what you need: