Instead of:
Hello,
Thank you dfasdfasdfasdf asdf asdf asdfas dfs
Please, feelasdf asdf asdf
The email that arrives in my mailbox looks like the following:
<p>Hello,</p>
<p> </p>
<p>Thank you dfasdfasdfasdf asdf asdf asdfas dfs</p>
<p> </p>
<p>Please, feel asdfads fad f</p>
So, I guess the HTML is not turned on for the wp_mail()
function? How do you turn it on so the mail will arrive as it should and the <p>
and <br>
tags are interpreted correctly?
I am using this to send my mail from functions.php
when the submit button is pressed:
$headers = 'From: XXXXXX.com <info@xxxxx.com>' . "rn";
$subject = 'Registration from xxxxx.com' . "rn";
$message = $result_email_text;
wp_mail($_POST['admin_email'], $subject, $message, $headers );
The default content type is
'text/plain'
which does not allow using HTML. You can set the content type of the email by including a header like “Content-type: text/html”Or you can set it by using the
wp_mail_content_type
filterFor more detail see the following link:
http://codex.wordpress.org/Function_Reference/wp_mail