MyBB Community Forums

Full Version: [solved] MyBB was unable to send the email using the PHP mail() function.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,
I'm one of those who suffer from 'MyBB was unable to send the email using the PHP mail() function.', which myBB will not send email out to anyone. The problem is really severe when you use email verification method for new user registration ...

My resolution is that i have to make change in file \inc\mailhandlers\php.php by looking for

Quote: $sent = @mail($this->to, $this->subject, $this->message, trim($this->headers));

and

Quote:$sent = @mail($this->to, $this->subject, $this->message, trim($this->headers), $this->additional_parameters);

replace both with

Quote:$sent = @mail($this->to, $this->subject, $this->message);

the idea is to remove 4th and 5th parameters from mail() function.

That's all for my case!

Case Closed!!!

While this might "fix" the issue and start sending out the emails, the bottom line is that it wasn't working in the first place because your host has a problem with the headers that MyBB properly setup.
Also doing the above means that all the emails will have the from headers set to what the host sets up and not what you have in your admincp and even user-to-user emails will end up having the host's headers and not the from email of the user sending the email.

Theres even a higher possibility that your emails will end up in user's spam without the headers.