Hello. My server currently blocks all outgoing mail messages from NOBODY. How can i configure my phpmail function to not send out an e-mail from NOBODY so it won't get blocked? Thank you!
Why would you send a mail from nobody? I's better to validate the user's input before sending any emails. If you want it to be sent only from one email to all rrcipients, add it to the mail function and everything will be ok.
manilodisan - if you do a basic mail command with no extras it's up to the webserver who it says the email is from. If you haven't coded in a "from" header then it may well be from nobody. Is this desirable... no! But spammers don't care and that's why the webhosts block it. However this causes problems for newbie programmers. FWIW: I use http://phpmailer.sourceforge.net/ to send emails and it's so easy - it does all the hard work for me.
It's not desirable but it also means that your code is either incomplete or not safe. Why would I leave the thinking to the server whan I can leave only one door open and that's for the sender who MUST enter a valid email address (preferably a captcha too) before any mail function is executed. Of course, every critique is constructive and you may have a point for some situations that are better avoided. Anyways. Hope something good gets out.
I think maybe we've read the original post differently. My take on the situation was that shreder was sending the emails from a script and that the to email was ok, but that s/he wasn't specifying a from address. For instance in a contact form you would be sending the email to yourself with info like name, phone, comment and you wouldn't necessarily give a sender because it's coming from your own website. The webserver doesn't know that though and blocks the send (good behaviour) so shreder will need to put the headers in to send a good, fully formed email.
It show NOBODY, is either you left sender field empty or incorrect format. This format is correct: mail($email_to, $subject, $body, "From: Your Name <yourname@domain.com>"); PHP: