EchoFool Posted May 15, 2010 Share Posted May 15, 2010 Hey, When ever usesr recieve an email from my server their email shows: From: Nobody (nobody@server.domain.com) Why is this? Other companies and sites don't get this problem i wanted it to show my Business Name so it was easy to identify My script for the mail sent is: $subject = "Notification"; $headers = 'Content-type: text/html; charset=UTF-8'; $message = "Your account has changed its email! <br><br>All emails will now be directed to this email: <b>$EmailTemp</b> <br><br>Thanks"; mail($EmailTemp, $subject, $message, $headers); What did i get wrong? Or more like what did i miss ? Quote Link to comment Share on other sites More sharing options...
CodeMaster Posted May 15, 2010 Share Posted May 15, 2010 www.php.net/mail Your header information is not set: $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); Quote Link to comment Share on other sites More sharing options...
EchoFool Posted May 15, 2010 Author Share Posted May 15, 2010 www.php.net/mail Your header information is not set: $headers = 'From: [email]webmaster@example.com[/email]' . "\r\n" . 'Reply-To: [email]webmaster@example.com[/email]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); With that does that mean i cannot use $headers = 'Content-type: text/html; charset=UTF-8'; ? Quote Link to comment Share on other sites More sharing options...
CodeMaster Posted May 16, 2010 Share Posted May 16, 2010 You forgot to declare the From parameter in the headers. You can use the content-type parameters as well. Quote Link to comment 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.