dflow Posted October 24, 2011 Share Posted October 24, 2011 the following isnt sending mail() $to=$_POST['CustomerEmail']; $from = "s@xaa.com"; $Cc = "s@xaa.com"; $headers = "From:" . $from; $headers = "Cc:" . $Cc; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n"; i believe it's the dot before the equal sign Quote Link to comment https://forums.phpfreaks.com/topic/249736-mail-headers-error/ Share on other sites More sharing options...
Pikachu2000 Posted October 24, 2011 Share Posted October 24, 2011 Your $headers variable is overwritten twice before it even gets to that point. Have you echoed anything out for debugging? Quote Link to comment https://forums.phpfreaks.com/topic/249736-mail-headers-error/#findComment-1281882 Share on other sites More sharing options...
requinix Posted October 24, 2011 Share Posted October 24, 2011 You aren't calling mail() My point is that you're giving us incomplete code. It's great that you think it's the headers at fault, but how about showing everything just in case it isn't? Quote Link to comment https://forums.phpfreaks.com/topic/249736-mail-headers-error/#findComment-1281888 Share on other sites More sharing options...
ManiacDan Posted October 24, 2011 Share Posted October 24, 2011 $headers = "From:" . $from; //$headers is now "From: somebody@somedomain.com" $headers = "Cc:" . $Cc; //$headers is now "Cc: somebodyElse@someOtherDomain.com" $headers = 'MIME-Version: 1.0' . "\r\n"; //$headers is now "MIME-Version: 1.0" You're over-writing headers every time. The concatenation operator (.=) allows you to APPEND headers (though note that \r\n needs to be at the end of every line of the headers). -Dan Quote Link to comment https://forums.phpfreaks.com/topic/249736-mail-headers-error/#findComment-1281901 Share on other sites More sharing options...
dflow Posted October 25, 2011 Author Share Posted October 25, 2011 $headers = "From:" . $from; //$headers is now "From: somebody@somedomain.com" $headers = "Cc:" . $Cc; //$headers is now "Cc: somebodyElse@someOtherDomain.com" $headers = 'MIME-Version: 1.0' . "\r\n"; //$headers is now "MIME-Version: 1.0" You're over-writing headers every time. The concatenation operator (.=) allows you to APPEND headers (though note that \r\n needs to be at the end of every line of the headers). -Dan roger that Quote Link to comment https://forums.phpfreaks.com/topic/249736-mail-headers-error/#findComment-1282092 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.