MyBB Community Forums

Full Version: Where is the php mail function getting called?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've some problem in mail reply notifications so I want to print the parameters being passed to the mail function. Is it the one in functions.php?

In mail reply notifications Sent From is empty so the gmail shows it as "Unknown Sender".

I think it is in function.php and I've printed the values when it gets called when I reply a message.

In the my_mail function in functions.php it is printing:

from=, , header=, ....., ,return_email=

It means from is empty, header and return_email also are empty in the function mail->build_message.

Any advice appreciated.
Some webhosts have various restrictions on PHP mail. Some hosts require that the "From" address be a mailbox address on their server. Other hosts may disable the mail function completely. Please ask your webhost if there are any special restrictions they have on sending mail via PHP.

If your webhost has restricted that only mails from there own domain is allowed, try to edit the file inc/functions.php. Look for:

mail($to, $subject, $message, $headers);
and include above: ini_set("sendmail_from", " [email protected] "); 
Then it should look like this:

ini_set("sendmail_from", " [email protected] ");
mail($to, $subject, $message, $headers);
YOURDOMAIN must be replaced by the domain where the forum is hosted.


Copied from the Wiki.
Joshua
I'm looking at it, by the time I want to tell you that I have 2 more phpbb forums with no issues and 10 Joomla+Drupal sites with no problems.
And HostGator(my host) seem to be pretty popular.

I'd not mind giving you the login passwd for admin.

Thanks for your help Smile
I don't see any line like mail(...).

Are you talking about this line:
my_mail($email['mailto'], $email['subject'], $email['message'], $email['mailfrom'], "", $email['headers']);

Also do you mean the " [email protected] " to be the return email id?

...Ok I've changed by adding ini_set but no affect:
  ini_set("sendmail_from", "[email protected]");
        $mail->build_message($to, $subject, $message, $from, $charset, $headers, $format, $message_text, $return_email);

(2011-08-08, 09:20 AM)Joshua Mayer Wrote: [ -> ]If your webhost has restricted that only mails from there own domain is allowed, try to edit the file inc/functions.php. Look for:

mail($to, $subject, $message, $headers);
and include above: ini_set("sendmail_from", " [email protected] "); 
Then it should look like this:

ini_set("sendmail_from", " [email protected] ");
mail($to, $subject, $message, $headers);
YOURDOMAIN must be replaced by the domain where the forum is hosted.


Copied from the Wiki.


This change is solving the problem:

Adding this line in the beginning of build_message in class_mailhandler.php:

$from="[email protected]";
 $return_email="contactus@indianworkingwoman;


I've printed the values of those two. They are being passed as empty string "".
Looks like

 "mailfrom" => '',
in file datahandlers/post.php may be the problem.