Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Update variable settings.
- * Load to your WP root folder.
- */
- // Set $to as the email you want to send the test to
- $to = "your@email.com";
- $subject = 'wp_mail function test';
- $message = '------=_Part_18243133_1346573420.1408991447668
- Content-Type: text/plain; charset=UTF-8
- Hello world! This is plain text...
- ------=_Part_18243133_1346573420.1408991447668
- Content-Type: text/html; charset=UTF-8
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- </head>
- <body>
- <p>Hello World! This is HTML...</p>
- </body></html>
- ------=_Part_18243133_1346573420.1408991447668--';
- $headers = "MIME-Version: 1.0\r\n";
- $headers .= "From: Foo <foo@bar.com>\r\n";
- $headers .= 'Content-Type: multipart/alternative;boundary="----=_Part_18243133_1346573420.1408991447668"';
- // 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!';
- };
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement