getaway
getaway

Reputation: 8990

formatting email in php?

$to = "$email";
$subject = "Thank You";
$message = "<p>Thanks for applying</p>";
$from = "[email protected]";
$headers = "From: $from";
mail($to,$subject,$message,$headers);

when i send this email to myself, i still see the html tags, why is this thanks!!

Upvotes: 1

Views: 266

Answers (2)

Delan Azabani
Delan Azabani

Reputation: 81384

You need to send the Content-type header as text/html.

For example, change the $headers line to

$headers = "From: $from";
$headers .= "\nContent-type: text/html";

Upvotes: 4

Babiker
Babiker

Reputation: 18798

You need to set your headers content type. Like:

$headers.= 'Content-type: text/html; charset=UTF-8' . "\r\n";

Upvotes: 1

Related Questions