In this example you'll need to edit the recipient from the snippet below and then create a file in the specified directory.
Since this is an MU plugin it doesn't need to be specifically activated and therefore those who have access to the site via FTP can remove it.
The closing php tag is intentionally omitted so there is no whitespace inserted accidentally.
After you add it to your WordPress site, access it by passing ?mail_test parameter this will trigger the email test.
You should see Mail sent?: Yes or Mail sent?: No
e.g. site.com/?mail_test
Target File: wp-content/mu-plugins/my_custom_email_tester.php
[code]
<?php
add_action('plugins_loaded', 'my_email_tester');
function my_email_tester() {
if (isset($_REQUEST['mail_test'])) {
echo 'Mail sent?: '
. ( wp_mail( 'help@example.com', 'The subject', 'The message' ) ? 'Yes' : 'No' );
wp_die(__FILE__);
}
}
[/code]