MyBB Community Forums

Full Version: Activation emails not sent unless headers parameter to mail() function commented out
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

A group of us have set up a new MyBB 1.8.12 forum here:

During testing, we found that activation emails weren't being sent. I tried to debug this, and despite my best efforts, the only way I could get these emails to send was by commenting out the "headers" and "additional parameters" arguments to the mail() function in inc/mailhandlers/php.php:

                        $sent = mail($this->to, $this->subject, $this->message/*, trim($this->headers), $this->additional_parameters*/);

Has anybody else had this problem? Does anyone know how to solve it? I mean, emails are now functional, but I worry about the unintended consequences of not having these headers set.

Additional info: my web hosting provider is Hostgator. I am on a shared server.

Any and all help gratefully accepted.


Sorry, I've realised I wasn't clear:

There was never any error with sending the emails. The only problem is that they were never received.
I set this problem aside and just got back to it. I think what was going on is that we had set our admin email to a Gmail account, and some recipient mail servers (especially Gmail servers) wouldn't accept that as a valid "From" header for the default mail server from which our host (Hostgator) sends mail using the PHP mail() function.

I've now set our admin email address to a mailbox at our actual domain and everything's working fine now - have been able to remove the commented-out parameters.