MyBB Community Forums

Full Version: cant get mybb to work with PHP mail
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So i switched the mail handler to PHP mail in MyBB but i am not getting anything sent out.

I know php mail works as i wrote a script 
<?php
    ini_set( 'display_errors', 1 );
    error_reporting( E_ALL );
    $from = "[email protected]";
    $to = "MY_PERSONAL_EMAIL";
    $subject = "PHP Mail Test script";
    $message = "This is a test to check the PHP Mail functionality";
    $headers = "From:" . $from;
    mail($to,$subject,$message, $headers);
    echo "Test email sent";
?>

and if i run that script or put it in my root and go there via the web, i get an email with that content. So why does MyBB not seem to be working with PHP mail?

AM i suppose to be putting something in the additional parameters field?

IF i look in the mail log i see
Quote:MyBB was unable to send the email using the PHP mail() function.
have you checked the system mail log at tools & maintenance section of forum admin panel ?
if so its latest entries should be having the error details.
I updated the original post with the admin panel error.

The only error i see is for the milter service...which was me trying to get the php mail out of Googles spam folders.

metulburr ~ $ sudo tail -f /var/log/mail.log
Dec 10 22:00:40 python-forum postfix/smtp[21527]: A89851408E2: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[173.194.206.27]:25, delay=0.44, delays=0.02/0/0.3/0.12, dsn=2.0.0, status=sent (250 2.0.0 OK 1512961240 d128si9380240qkb.85 - gsmtp)
Dec 10 22:00:40 python-forum postfix/qmgr[18006]: A89851408E2: removed
Dec 10 22:09:02 python-forum postfix/cleanup[21678]: warning: database /etc/postfix/virtual.db is older than source file /etc/postfix/virtual
Dec 10 22:09:02 python-forum postfix/pickup[18005]: 257B91408E2: uid=0 from=<root>
Dec 10 22:09:02 python-forum postfix/trivial-rewrite[21679]: warning: database /etc/postfix/virtual.db is older than source file /etc/postfix/virtual
Dec 10 22:09:02 python-forum postfix/cleanup[21678]: warning: connect to Milter service inet:localhost:8891: Connection refused
Dec 10 22:09:02 python-forum postfix/cleanup[21678]: 257B91408E2: message-id=<[email protected]>
Dec 10 22:09:02 python-forum postfix/qmgr[18006]: 257B91408E2: from=<[email protected]>, size=813, nrcpt=1 (queue active)
Dec 10 22:09:06 python-forum postfix/smtp[21680]: 257B91408E2: to=<[email protected]>, orig_to=<root>, relay=eforward3.registrar-servers.com[162.255.118.61]:25, delay=4.3, delays=0.02/0.01/1/3.3, dsn=2.0.0, status=sent (250 OK id=1eOESl-0006yf-Nn)
Dec 10 22:09:06 python-forum postfix/qmgr[18006]: 257B91408E2: removed
Quote:Dec 10 22:09:02 python-forum postfix/trivial-rewrite[21679]: warning: database /etc/postfix/virtual.db is older than source file /etc/postfix/virtual

https://stackoverflow.com/questions/1266...send-issue

Run:

postmap /etc/postfix/virtual

Then restart postfix.
Oh yeah i just made additions to the file adding all the other admins into it. But i had mine in there originally set.

i dont get any error on the server when i use MYBB to send mail. On Mybb it still says. MyBB was unable to send the email using the PHP mail() function.

I only get a serverside error when i send mail though the server
echo "This is the body of the email" | mail -s "arggggg" PERSONAL_EMAIL_REMOVED


log file
Dec 11 09:07:22 python-forum postfix/pickup[6360]: D5D1B1408E1: uid=1000 from=<metulburr@python-forum>
Dec 11 09:07:22 python-forum postfix/cleanup[6485]: warning: connect to Milter service inet:localhost:8891: Connection refused
Dec 11 09:07:22 python-forum postfix/cleanup[6485]: D5D1B1408E1: message-id=<[email protected]>
Dec 11 09:07:22 python-forum postfix/qmgr[6361]: D5D1B1408E1: from=<metulburr@python-forum>, size=412, nrcpt=1 (queue active)
Dec 11 09:07:23 python-forum postfix/smtp[6487]: connect to gmail-smtp-in.l.google.com[2607:f8b0:400d:c00::1a]:25: Network is unreachable
Dec 11 09:07:23 python-forum postfix/smtp[6487]: D5D1B1408E1: to=<PERSONAL_EMAIL_ERMOVED>, relay=gmail-smtp-in.l.google.com[74.125.124.26]:25, delay=0.74, delays=0.03/0.03/0.4/0.27, dsn=2.0.0, status=sent (250 2.0.0 OK 1513001243 p203si6094540itg.131 - gsmtp)
Dec 11 09:07:23 python-forum postfix/qmgr[6361]: D5D1B1408E1: removed
with nothing in the mail error file.
Quote:Dec 11 09:07:23 python-forum postfix/smtp[6487]: connect to gmail-smtp-in.l.google.com[2607:f8b0:400d:c00::1a]:25: Network is unreachable

Okay, that's an IPv6 address. Does your server support it fully? Does your Postfix support it? It's saying network is not reachable. From SSH try to telnet to the address.

telnet 2607:f8b0:400d:c00::1a 25

You should get a helo response. If not then that's what you have to fix.
I have no idea about that. I am not even sure why google.com is listed as im not trying to replay SMTP to them at all, but make my own mail server. 

metulburr ~ $ telnet 2607:f8b0:400d:c00::1a 25
Trying 2607:f8b0:400d:c00::1a...
telnet: Unable to connect to remote host: Network is unreachable
You have a server misconfiguration then. Could be DNS or maybe ipv6.

Did you setup your resolv.conf?
I havent heard of that file at all.
Should it even matter what my server config is. If my php mail is working and able to send out mail via terminal, then shouldnt MyBB use it to send out mail without a problem? I could care less about incoming mail....i only care about activation and subscription emails sent out via MyBB.