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.");'
Shared by Nikul Valani · July 24, 2026 · @wp_mail
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.");'