johnnybt wrote:
Code: Select all
$headers .= "e;From: $name <$email>\r\n"e;;
$headers .= "e;Cc: $email\r\n"e;;
The $headers variable has not been initialized to a default value, and you are concatenating right away...
Try:
Code: Select all
$headers = '';
$headers .= "e;From: $name <$email>\r\n"e;;
$headers .= "e;Cc: $email\r\n"e;;
Or just:
Code: Select all
$headers = "e;From: $name <$email>\r\n"e;;
$headers .= "e;Cc: $email\r\n"e;;
Also, depending on the OS of the server, the Line-endings may differ.. What I tend to do (I dont know if this is a best-practices method or not) is always use \n in my strings, and then pass them to a FixEOL() function, to correct the line-endings depending on the OS, like:
Code: Select all
function FixEOL( &$szData )
{
if( strtoupper( substr( PHP_OS, 0, 3 ) == 'WIN' ) )
$szData = str_replace( "e;\n"e;, "e;\r\n"e;, $szData );
else if( strtoupper( substr( PHP_OS, 0, 3 ) == 'MAC' ) )
$szData = str_replace( "e;\n"e;, "e;\r"e;, $szData );
return;
}
Anyway, I hope that helps!