The WPFolks app is out on iPhone and Android. Free, no ads. Download on the App Store Get it on Google Play
Skip to main content
Login Join
Snippet · Bash / Shell

Test WordPress Email Functionality Using WP-CLI

Shared by Nikul Valani · July 24, 2026 · @wp_mail

5 copies
100 views
Back to Snippets

Use this WP-CLI command to send a test email from your WordPress site and verify that the wp_mail() function is working correctly.

wp eval 'wp_mail("abc50@gmail.com", "WP-CLI Email Test", "This is a test email sent via WP-CLI.");'
Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments

Proudly supported by