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

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