steve m Posted February 6, 2008 Share Posted February 6, 2008 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: some_email_adress@example.com\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: info@rcubed.com\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); ?> Quote Link to comment https://forums.phpfreaks.com/topic/89767-bad_header-improper-use-of-control-character-char-0d-hex/ 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.