Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. // Set $to as the email you want to send the test to.
  2. $to = "you@yoursite.com";
  3.  
  4. // Email subject and body text.
  5. $subject = 'wp_mail function test';
  6. $message = 'This is a test of the wp_mail function: wp_mail is working.woo!';
  7. $headers = '';
  8.  
  9. // Load WP components, no themes.
  10. define('WP_USE_THEMES', false);
  11. require('wp-load.php');
  12.  
  13. // send test message using wp_mail function.
  14. $sent_message = wp_mail( $to, $subject, $message, $headers );
  15.  
  16. //display message based on the result.
  17. if ( $sent_message ) {
  18. // The message was sent.
  19. echo 'The test message was sent. Check your email inbox.';
  20. }
  21. else {
  22. // The message was not sent.
  23. echo 'The message was not sent!';
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement