Hi guys I am trying to send HTML email with php. When I click on button on one page it loads php file and sends it data that should go in mail. That data is HTML code, I also use same variable/code to generate content in that PHP file. Content is generated perfectly but E-mail is empty, altought i send same variable that I use to make content on that page. Code is
<?php
$message=$_POST["email"];
echo $message;//Use variable to generate content
if (isset($_POST['button1']))
{
$to = 'test@gmail.com';
$subject = 'Subject';
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=iso-8859-1';
mail($to, $subject, $message, implode("\r\n", $headers));
}
?>
<form method="POST" action=''>
<input type="submit" name="button1" value="Send mail" class="btn">
EDIT: If i type html code manualy it works.