MyBB Community Forums

Full Version: Error: My bb was unable to send mail through php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I checked http://wiki.mybb.com/index.php/Help:Mail
but my server only allow domain name mails, like,
[email protected]
so i found
mail($to, $subject, $message, $headers);
in my inc/function.php
but this line is not written in it, the only thing resembles to it is

function my_mail($to, $subject, $message, $from="", $charset="", $headers="", $keep_alive=false, $format="text", $message_text="", $return_email="")

then where to put
ini_set("sendmail_from", " [email protected] ");
this line ?
You need to use SMTP mail then, not PHP mail.
SMTP is not allowed in my case, only php, but where to add that line?

ini_set("sendmail_from", " [email protected] ");
Why can;t you do SMTP? Many mail carriers like Yahoo and Gmail don't accept php mail.
(2011-06-30, 11:14 AM)sunjava1 Wrote: [ -> ]I checked http://wiki.mybb.com/index.php/Help:Mail
but my server only allow domain name mails, like,
[email protected]
so i found
mail($to, $subject, $message, $headers);
in my inc/function.php
but this line is not written in it, the only thing resembles to it is

function my_mail($to, $subject, $message, $from="", $charset="", $headers="", $keep_alive=false, $format="text", $message_text="", $return_email="")

then where to put
ini_set("sendmail_from", " [email protected] ");
this line ?

That line only needed to be added in the older versions of MyBB. The newer versions automatically set the ini_set. What you need to do is to set the emails that your server is allowing as the admin and return-to email.
If it still does not work then you will need to contact your host about this and ask them why emails are not working.

(2011-06-30, 10:01 PM)Darth Stabro Wrote: [ -> ]Why can;t you do SMTP? Many mail carriers like Yahoo and Gmail don't accept php mail.

That is not entirely true. They do accept PHP mail, but it has to be sent with the proper headers and from a host that is not blacklisted.
Not working , what should i DO? my host is, 000webhost.com they allow php mail, but test of php mail function from http://wiki.mybb.com/index.php/Help:Mail said
Php Could not send mail, whats the reason of it?
Contact your host about the matter.
Thanks for this awesome tip