My website is set up to e-mail me - as the Admin - when there is an error on a webpage. In my Gmail, I am getting this in the FROM column... ...which is obviously syntactically messed up?! Here is the code I have in my script which sends the e-mail... $headers = "From: admin@MySite.com <admin@MySite.com>\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; mail('Debbie@gmail.com', 'Re: Website #: ' . rand(5, 1000), $body, $headers); PHP: The only thing I can think of is that my Single Quotes are messing something up?! (BTW, I am getting the e-mail, and it is readable, but I just want the format of the FROM to be correct...) Thanks, Debbie
Replace this $headers = "From: admin@MySite.com <admin@MySite.com>\r\n"; PHP: With this: $headers = "From: Admin <admin@MySite.com>\r\n"; PHP: Or this: $headers = "From: admin@MySite.com\r\n"; PHP: I assume the From headers should have the same format as the recipient http://php.net/manual/en/function.mail.php#refsect1-function.mail-parameters: