I am having a problem with my mail() header tag.
$headers = '';
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/plain; charset=iso-8859-1' . "\r\n";
$headers .= 'From: ' . trim(stripslashes($from_name)) . ' <' . trim(stripslashes($from_email)) . '>, ' . "\r\n";
$headers .= 'Bcc: ' . trim(stripslashes($from_email)) . "\r\n";
$headers .= 'Reply-To: ' . trim(stripslashes($from_email)) . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
I can eliminate the error on the LIVE server by not having any spaces in the $from_name variable. So FirstNAME works but First NAME breaks the code. Any idea why this is?
Plus the actual spaces in the coding cause an error. Below is coding that works for the time being.
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'From:' . $from_name . "\r\n";
$headers .= 'Bcc: ' . trim(stripslashes($from_email)) . "\r\n";
$headers .= 'Reply-To: ' . trim(stripslashes($from_email)) . "\r\n";
$headers .= 'X-Mailer😛HP/' . phpversion();
Like I said, as long as $from_name is singular it works, otherwise ERROR!
Ugh!