Created
April 22, 2015 05:20
-
-
Save lunaroja/d7ea63f66f83f018f1b8 to your computer and use it in GitHub Desktop.
wp_mail function test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Update variable settings. | |
* Load to your WP root folder. | |
*/ | |
// Set $to as the email you want to send the test to | |
$to = ""; | |
// No need to make changes below this line | |
// Email subject and body text | |
$subject = 'wp_mail function test'; | |
$message = 'This is a test of the wp_mail function: wp_mail is working'; | |
$headers = ''; | |
// Load WP components, no themes | |
define('WP_USE_THEMES', false); | |
require('wp-load.php'); | |
// Call the wp_mail function, display message based on the result. | |
if( wp_mail( $to, $subject, $message, $headers ) ) { | |
// the message was sent... | |
echo 'The test message was sent. Check your email inbox.'; | |
} else { | |
// the message was not sent... | |
echo 'The message was not sent!'; | |
}; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment