Jump to content

PHP mail() error


aaronfenker

Recommended Posts

I'm trying to use the mail() function to send an email containing a table, but it keeps failing.  I'm not sure what the problem is.  It doesn't throw any syntax errors in terminal.  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>");

Link to comment
https://forums.phpfreaks.com/topic/47948-php-mail-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.