I tried questions already answered over here (this, this, this, and others...), but nothing get worked... i have this function to send an email:
function send_email($para, $assunto, $msg){
$to = $para;
$subject = $assunto;
$message = '<html><body>';
$message .= str_replace("\\r\\n","<br/>",$msg);
$message .= '</body></html>';
$headers = 'From: email@realemail.com' . "\r\n";
$headers .= 'Reply-To: email@realemail.com' . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion() . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
return mail($to, $subject, $message, $headers);
}
And i'm calling this with something like that:
$var = "<p><strong>...blablabla...</strong></p>";
send_email("email@email", "lalala", $var);
I can send the email, but it ins't html formatted (and it contains the html tags, except for HTML
and BODY
). What am i doing wrong?
EDIT 1:
The email is displayed like this (exactly the same content sent, except for HTML
and BODY
TAG):
BEGIN
<p><strong>...blablabla</strong></p>
END
When i get the full email (like this tutorial), shows up that the email was sent with TAGS html, body, etc... A piece of the email:
Delivered-To: myemail@gmail.com
...
To: myemail@gmail.com
Subject: aaaaaaaaaaaaaaaaaaaaa
From: sender@email.com
Reply-To: sender@email.com
X-Mailer: PHP/5.6.19
Content-type: text/html; charset=iso-8859-1
MIME-Version: 1.0
...
Date: Tue, 29 Nov 2016 15:51:48 -0200
...
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - svr1.ravehost.com.br
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [99 497] / [47 12]
X-AntiAbuse: Sender Address Domain - svr1.ravehost.com.br
<html><body>...blablabla...</body></html>
Prepared do an dissuade be....
Society excited by cottage private an it esteems. ...Whole every miles as tiled at seven or. .
`