Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $email_to = 'someaddress@gmail.com';
- $email_subject = 'Email subject';
- $email_body = "<html><body><h1>Hello World!</h1></body></html>";
- $send_mail = wp_mail($email_to, $email_subject, $email_body);
- // In theme's functions.php or plug-in code:
- function wpse27856_set_content_type(){
- return "text/html";
- }
- add_filter( 'wp_mail_content_type','wpse27856_set_content_type' );
- $to = 'sendto@example.com';
- $subject = 'The subject';
- $body = 'The email body content';
- $headers = array('Content-Type: text/html; charset=UTF-8');
- wp_mail( $to, $subject, $body, $headers );
- remove_filter( 'wp_mail_content_type','wpse27856_set_content_type' );
- if ( !isset( $content_type ) )
- $content_type = 'text/html';
Add Comment
Please, Sign In to add comment