Is there a way to send HTML formatted emails with WordPress’ wp_mail() function?
Question
Is there an action_hook or something similar that could help me achieve this?
I tried adding markup in a PHP string variable and just fired off an email with the wp_mail()
function like so:
$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);
But it showed up as plain text?
Any ideas?
in progress
0
hooks, html-email, wp-mail
11 years
2011-09-06T16:08:38-05:00
2011-09-06T16:08:38-05:00 0 Answer
89 views
0
Answer ( 1 )
from wp_mail codex page:
// 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' );