WordPress action hook · part of WordPress core

wp_mail_succeeded

A WordPress core action that 58 plugins also fire themselves, running on 1.4M+ sites between them.

“Fires after a successful email is sent using the wp_mail() function.”

How to use wp_mail_succeeded

It's an action: your callback runs at that point and receives 1 argument. Nothing needs to be returned. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_action( 'wp_mail_succeeded', function( $mail_data ) {
	// Your code runs here.
}, 10, 1 );

Argument names come from FluentSMTP's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

58 plugins that fire wp_mail_succeeded

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. FluentSMTP icon FluentSMTP700,000+ installs do_action( 'wp_mail_succeeded', $mail_data ) app/Functions/helpers.php:833
  2. Post SMTP icon Post SMTP300,000+ installs do_action( 'wp_mail_succeeded', $atts ) Postman/PostmanWpMailBinder.php:152
  3. SureMail icon SureMail200,000+ installs do_action( 'wp_mail_succeeded', $mail_data ) inc/emails/default-mail-handler.php:415
  4. Mailgun for WordPress icon Mailgun for WordPress70,000+ installs do_action( 'wp_mail_succeeded', $mail_data ) includes/wp-mail-api.php:723
  5. SMTP Mailer icon SMTP Mailer70,000+ installs do_action( 'wp_mail_succeeded', $mail_data ) main.php:1103
  6. ActiveCampaign Postmark for WordPress icon ActiveCampaign Postmark for WordPress50,000+ installs do_action( 'wp_mail_succeeded', array( 'to' => $body['To'], 'subject' => $body['Subject'], 'message' => $body['HtmlBody'] ?? $body['TextBody'], 'headers' => $recognized_headers, 'attachments' => $body['Attachments'] ?? null, ) ) wp-mail.php:335
  7. Infinity23 (Formerly Tag Manager) icon Infinity23 (Formerly Tag Manager)20,000+ installs do_action( 'wp_mail_succeeded', $infinity23_elastic_mail_data ) essential/email-smtp/back-end/back-end.php:782
  8. Gmail SMTP icon Gmail SMTP10,000+ installs do_action( 'wp_mail_succeeded', $mail_data ) main.php:1193
  9. Swift SMTP (formerly Welcome Email Editor) icon Swift SMTP (formerly Welcome Email Editor)7,000+ installs do_action( 'wp_mail_succeeded', $mail_data ) modules/smtp/class-smtp-output.php:234
  10. Groundhogg icon Groundhogg2,000+ installs do_action( 'wp_mail_succeeded', $mail_data ) includes/pluggable.php:556
  11. Bit SMTP icon Bit SMTP2,000+ installs do_action( 'wp_mail_succeeded', $mailData ) backend/app/Mail/Dispatch/WpMailBridge.php:677
  12. SmartSMTP icon SmartSMTP2,000+ installs do_action( 'wp_mail_succeeded', $mail_data ) includes/Services/Services.php:559
  13. Meow Mailer icon Meow Mailer1,000+ installs do_action( 'wp_mail_succeeded', [ 'to' => $email['to'], 'subject' => $email['subject'], 'message' => $email['message'], 'headers' => $email['headers_raw'], 'attachments' => $email['attachments'], ] ) classes/modules/mailer.php:265
  14. Infinite Uploads icon Infinite Uploads800+ installs do_action( 'wp_mail_succeeded', $mail_data ) inc/InfiniteUploadsWPMail.php:440
  15. Resend icon Resend500+ installs do_action( 'wp_mail_succeeded', array( 'to' => $body['to'], 'subject' => $body['subject'], 'message' => $body['html'] ?? $body['text'], 'headers' => $headers, 'attachments' => $body['attachments'] ?? null, ) ) wp-mail.php:136
  16. turboSMTP icon turboSMTP400+ installs do_action( 'wp_mail_succeeded', array_merge( $mail_atts, array( 'api_response' => $mail_sent_response ) ) ) public/class-turbosmtp-public.php:209
  17. aDirectory icon aDirectory300+ installs do_action( 'wp_mail_succeeded', $mail_data ) inc/EmailSender.php:408
  18. Custom SMTP: Email Deliverability icon Custom SMTP: Email Deliverability200+ installs do_action( 'wp_mail_succeeded', $success_data ) src/Mail/SesMailer.php:158
  19. AIO Tools (All in One Tools) icon AIO Tools (All in One Tools)100+ installs do_action( 'wp_mail_succeeded', $mail_data ) modules/smtp/class-aio-mailer.php:770
  20. Kaddora MailFlow SMTP icon Kaddora MailFlow SMTP40+ installs do_action( 'wp_mail_succeeded', array( 'to' => $message->to, 'subject' => $message->subject, 'message' => $message->body, 'headers' => $message->headers, 'attachments' => $message->attachments ) ) includes/mail/class-kms-delivery-manager.php:149
  21. SendForce Mail SMTP Relay icon SendForce Mail SMTP Relay30+ installs do_action( 'wp_mail_succeeded', $atts ) includes/class-sendforce-mailer.php:375
  22. Authentic Sender icon Authentic Sender20+ installs do_action( 'wp_mail_succeeded', $atts ) includes/class-api-mailer.php:98
  23. API Mailer for AWS SES icon API Mailer for AWS SES20+ installs do_action( 'wp_mail_succeeded', $mail_data ) src/Mail/Mailer.php:113
  24. Kelune CRM icon Kelune CRM10+ installs do_action( 'wp_mail_succeeded', $mail_data ) includes/Services/SiteMailerService.php:101
  25. Sendelva icon Sendelva10+ installs do_action( 'wp_mail_succeeded', $atts ) sendelva.php:335
  26. Lean SMTP icon Lean SMTP10+ installs do_action( 'wp_mail_succeeded', $mail_data ) includes/class-lean-smtp-mailer.php:292
  27. PowerSuite Modular Admin Toolkit icon PowerSuite Modular Admin Toolkit10+ installs do_action( 'wp_mail_succeeded', $atts ) modules/email-smtp/includes/EmailRouter.php:236
  28. Trigger icon TriggerFewer than 10 installs do_action( 'wp_mail_succeeded', $mail_data ) inc/Core/TriggerMailer.php:429
  29. Duva Mail icon Duva MailFewer than 10 installs do_action( 'wp_mail_succeeded', self::mail_data( $atts ) ) includes/class-duva-mail-mailer.php:46
  30. eusend icon eusendFewer than 10 installs do_action( 'wp_mail_succeeded', $atts ) includes/class-eusend-mailer.php:137
  31. EnjinMel SMTP icon EnjinMel SMTPFewer than 10 installs do_action( 'wp_mail_succeeded', array( 'to' => $args['to'], 'subject' => $args['subject'], 'message' => $args['message'], 'headers' => $args['headers'], 'attachments' => $args['attachments'], 'transport' => 'enjinmel_rest', 'legacy_transport' => 'enginemail_rest', ) ) enjinmel-smtp.php:507
  32. SendFleet icon SendFleetFewer than 10 installs do_action( 'wp_mail_succeeded', $mail_data ) includes/class-mailer.php:127
  33. Codo Mailer icon Codo MailerFewer than 10 installs do_action( 'wp_mail_succeeded', $mail_data ) src/Mail/Dispatcher.php:157
  34. Connector for bluefox.email icon Connector for bluefox.emailFewer than 10 installs do_action( 'wp_mail_succeeded', $mail_data ) modules/mailer/class-mailer.php:137
  35. Mersal SMTP icon Mersal SMTPFewer than 10 installs do_action( 'wp_mail_succeeded', $mail_data ) includes/class-mersal-smtp-mailer.php:121
  36. Frumbik SMTP icon Frumbik SMTPFewer than 10 installs do_action( 'wp_mail_succeeded', $wpMailArgs ) src/Mail/WpMailOverride.php:261
  37. GlobalDev SMTP icon GlobalDev SMTPFewer than 10 installs do_action( 'wp_mail_succeeded', $atts ) includes/class-gds-core.php:219
  38. Aluleth SMTP icon Aluleth SMTPFewer than 10 installs do_action( 'wp_mail_succeeded', self::mail_data( $atts ) ) includes/class-sender.php:202
  39. Titanium Mail SMTP icon Titanium Mail SMTPFewer than 10 installs do_action( 'wp_mail_succeeded', $atts ) includes/class-tmsmtp-plugin.php:770
  40. Beacon Campaign Sender icon Beacon Campaign SenderFewer than 10 installs do_action( 'wp_mail_succeeded', $atts ) includes/class-bcsend-smtp.php:259
  41. Emercury SMTP Mail icon Emercury SMTP MailFewer than 10 installs do_action( 'wp_mail_succeeded', $atts ) src/Core/Mailer.php:229
  42. Kelune SMTP icon Kelune SMTPFewer than 10 installs do_action( 'wp_mail_succeeded', $atts ) includes/Mailer/Mailer.php:283
  43. SMTPing Email Suite: SMTP, Newsletter & Email Verification icon SMTPing Email Suite: SMTP, Newsletter & Email VerificationFewer than 10 installs do_action( 'wp_mail_succeeded', $atts ) includes/class-smtping-smtp-mailer.php:97
  44. Lettr icon LettrFewer than 10 installs do_action( 'wp_mail_succeeded', array( 'to' => $body['to'], 'subject' => $body['subject'], 'message' => isset( $body['html'] ) ? $body['html'] : ( isset( $body['text'] ) ? $body['text'] : '' ), 'headers' => $headers, 'attachments' => isset( $body['attachments'] ) ? $body['attachments'] : null, ) ) wp-mail.php:288
  45. Postkeep icon PostkeepFewer than 10 installs do_action( 'wp_mail_succeeded', $atts ) includes/smtp-manager/class-smtp-mailer.php:887
  46. NoorSMTP icon NoorSMTPFewer than 10 installs do_action( 'wp_mail_succeeded', $mail_result ) src/Modules/GmailApi/GmailApiModule.php:380
  47. SMTP Senpai icon SMTP SenpaiFewer than 10 installs do_action( 'wp_mail_succeeded', $mail_data ) includes/class-smtp-senpai-mailer.php:228
  48. MazeSMTP icon MazeSMTPFewer than 10 installs do_action( 'wp_mail_succeeded', $mail->toAtts() ) app/Mail/DeliveryService.php:462
  49. meil.ro icon meil.roFewer than 10 installs do_action( 'wp_mail_succeeded', $atts ) includes/class-meil-mailer.php:162
  50. MailBridgeAPI Email Delivery icon MailBridgeAPI Email DeliveryFewer than 10 installs do_action( 'wp_mail_succeeded', $atts ) includes/class-mailer.php:130
  51. GhostParse icon GhostParseFewer than 10 installs do_action( 'wp_mail_succeeded', $mail_data ) includes/class-mailer.php:55
  52. Virtual Solutions Client CRM icon Virtual Solutions Client CRMFewer than 10 installs do_action( 'wp_mail_succeeded', $mail_data ) includes/class-mailer.php:607
  53. Solviroa icon SolviroaFewer than 10 installs do_action( 'wp_mail_succeeded', is_array( $atts ) ? $atts : array() ) includes/class-cmw-mail-router.php:227
  54. Cybexsoft SMTP icon Cybexsoft SMTPFewer than 10 installs do_action( 'wp_mail_succeeded', self::mail_data( $atts ) ) includes/class-cybex-smtp-mail-handler.php:359
  55. SMTPMaster Email Sender icon SMTPMaster Email SenderFewer than 10 installs do_action( 'wp_mail_succeeded', $mail_data ) includes/class-smtpmaster-engine.php:353
  56. MailKite SMTP icon MailKite SMTPFewer than 10 installs do_action( 'wp_mail_succeeded', $mail_data ) src/Mail/Interceptor.php:111
  57. Flex SMTP icon Flex SMTPFewer than 10 installs do_action( 'wp_mail_succeeded', $atts ) includes/api-mailer.php:54
  58. Hiveify icon HiveifyFewer than 10 installs do_action( 'wp_mail_succeeded', $mail_data ?? [] ) hiveify.php:375

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.