Mail() generates an error on Windows

Error message:

Warning: mail(): SMTP server response: 451 
See http://pobox.com/~djb/docs/smtplf.html.

This error message indicates that you send email from PHP containing single linefeeds (\n) instead of real email linefeeds (\r\n).

You can read more about the problem here:

Usually you can fix this problem by making sure that before you call the mail() function you change all single \n to \r\n:

$ent = str_replace("rr", "r", str_replace("n", "rn", $ent));
Was this article helpful?

Related Articles