Link to home
Start Free TrialLog in
Avatar of movieprodw

asked on

Bounced email - Invalid new-line character sequence


I have an html form that send an email  to the client when someone fills out an inquery.

I just got this bounce response, do you know what it means and how to fix it?

Remote host said: 500 Invalid new-line character sequence

Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

That's a very picky email server.  Header lines are supposed to be terminated by '\r\n' aka CRLF.  Seems most mail servers will accept just '\n' but not all I guess.
Avatar of movieprodw


Well I just keep getting them and it is a little annoying, maybe it is my fault but I am just sending a contact inqury to a customer.

Here is the start of the email, can you please let me know if you see something obviously wrong.

$headers  = 'MIME-Version: 1.0' . "\r\n";
	$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
	$headers .= 'From: domain Online Inquiry <>' . "\r\n";
	$headers .= 'BCC: domain <>' . "\r\n";
	$headers .= 'Reply-to: '.$name.' <'.$email.'>' . "\r\n";
	$subject='domain Online Inquiry';

$body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

Open in new window

What server OS are you on, what is the SMTP server, and what is the remote server?  Are you using the PHP mail() function?  Technically you're supposed to use MIME boundaries to send HTML email although a lot of servers don't require it.
Yes I am using PHP mail(), I am calling it from a online form
And the server OS and SMTP server?

I do not know if I am using an smtp it is a standard LAMP server
Then SMTP is probably Sendmail or Postfix.  The SMTP server provided with IIS is picky about a few things.  Try sending a plain text email instead of HTML and see what happens.  Or I can post my PHP Email demo that you can try if you want.
I would love it if you had a html email demo!

Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I was able to send an email from my computer to it no problem, I will try the phpmailer.
Thank you
You're welcome, thanks for the points.