Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Set $to as the email you want to send the test to.
- $to = "you@yoursite.com";
- // Email subject and body text.
- $subject = 'wp_mail function test';
- $message = 'This is a test of the wp_mail function: wp_mail is working.woo!';
- $headers = '';
- // Load WP components, no themes.
- define('WP_USE_THEMES', false);
- require('wp-load.php');
- // send test message using wp_mail function.
- $sent_message = wp_mail( $to, $subject, $message, $headers );
- //display message based on the result.
- if ( $sent_message ) {
- // 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!';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement