I'm trying to use the mail() function to send me an email which contains a table. I'm pretty sure I have all the right headers, and I don't have any syntax errors. But instead of executing mail() it executes die(). My code is below.
$to = "******@gmail.com" . ",";
$to .= "******@gmail.com";
$subject = $_POST['firstnamecheck'] . " " . $_POST['lastnamecheck'] . " RSVPed";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: " . $_POST['firstnamecheck'] . " " . $_POST['lastnamecheck'] . "\r\n\r\n";
$headers .= $_POST['firstnamecheck'] . " " . $_POST['lastnamecheck'] . "has registered for the wedding.\r\n\r\n<b>Contact Information:</b>\r\n";
$message = "<html><table><tr><td align='left'>" . $_POST['firstnamecheck'] . " " . $_POST['lastnamecheck'] . "</td></tr><tr><td align='left'>" . $_POST['add1check'] . "</td></tr><tr><td align='left'>" . $_POST['add2check'] . "</td></tr><tr><td align='left'>" . $_POST['citycheck'] . "," . $_POST['statecheck'] . " " . $_POST['zipcheck'] . "</td></tr><tr><td align='left'></td></tr><tr><td align='left'>Response:" . $_POST['respcheck'] . "</td></tr><tr><td align='left'>Adults:" . $_POST['adultscheck'] . "</td></tr><tr><td align='left'>Children" . $_POST['childrencheck'] . "</td></tr></table></html>";
mail($to, $subject, $message, $headers) or die("<td class=\"content\" valign=\"top\">ERROR!!! <br /> PLEASE CONTACT THE BRIDE AND GROOM IMMEDIATELY!</td>");