Jump to content

BAD_HEADER: Improper use of control character (char 0D hex):


steve m

Recommended Posts

I need help.  I can't seem to figure this out.  I made a form where when submitted, it will email me and two others to notify us that someone is requesting some information.  Well, when somebody tries to submit the form, we get an email from our web host say that the mail was undeliverable - "BAD_HEADER: Improper use of control character (char 0D hex): From: [email protected]\r\n".  I can't for the life of me figure out why this is happening.  I've looked at the code and it seems to look all right.  Is there something wrong in the code? 

<?php
$To = preg_replace("/\r/", "", $_POST['email']);
$To = preg_replace("/\n/", "", $_POST['email']);

$headers = "From: $To\r\n";
$headers .= "Reply-To: $To\r\n";
$headers.= "Return-Path: [email protected]\r\n";
$headers .= "CC: $rmail_2, $rmail_3\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1";

mail($rmail_1, $Subject, $Message, $headers);
?>

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.