MyBB Community Forums

Full Version: PHP mail not sending - Please help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
The code you quoted is the one I had noticed was messed up. That has been replace by the simplephp.php code which was also attached in my previous post.

Quote:I guess the online editor really screwed it up because after noticing a very big difference between the two, I edited the simplephp.php using note pad, uploaded it to the site, renamed it to php.php and tried to send mail. I now get this error:

Parse error: syntax error, unexpected ')' in /www/itrello.com/n/e/e/(<EDIT: site name removed due to it no longer being hosted on itrello.com>)/htdocs/Forum/inc/mailhandlers

Attached here is the original php.php file that is from the MyBB package. I did no editing to this file other than renaming it, as instructed previously in this thread.

Okay, now that everyone is completely confused, Wink I guess what I need to know at this point is do I need to add a '(' or remove a ')' in the simplephp.php file to eliminate the syntax error above? I would like to try mailing using the simplephp.php file without coding errors occurring.

I have not yet been able try that file because of the coding errors, and the unexpected editor anomolies. -my bad- Anyway, if it solves the problem, great. If not, then I'll re-upload the original php.php file from the MyBB package and we can start again, if needed.

Thanks
Oh I see - In your simplephp.php file

// If safe mode is on, don't send the additional parameters as we're not allowed to
		if(ini_get('safe_mode') == 1 || strtolower(ini_get('safe_mode')) == 'on')
		{
			$sent = @mail($this->to, $this->subject, $this->message, );
		}
		else
		{
			$sent = @mail($this->to, $this->subject, $this->message,);
		}

There are extra commas right after $this->message - Those are causing the syntax errors; Just remove them and you'll be fine
Big GrinBig GrinBig Grin IT WORKED! Big GrinBig GrinBig Grin

I never would have caught that myself.

Angel Thankyou, Thankyou, Thankyou!!! Angel

It didn't show up in the log, but the email did arrive in my in box and that is the important thing. Thankyou Again! Big Grin

Boy, that was a ruff ride wasn't it?

I've attached the corrected & working simplephp.php file along with the instructions for others to use, if needed. Toungue

Thanks for all the help guys. VERY, VERY much appreciated. Big Grin

Should this now work for other email functions, too? (I.E. subscriptions, mass-mails, password requests, etc.)
(2008-10-25, 01:16 PM)dcaduser Wrote: [ -> ]Should this now work for other email functions, too? (I.E. subscriptions, mass-mails, password requests, etc.)

Yes it should, but please note you will have reduced functionality of the mail class. You will not be able to send HTML mass mails and the "from" and "reply-to" email addresses will not be shown. So this really isn't a "fix" but just a workaround. You should really find out which header that's being sent is causing the problem, then just removing that one.
Hmmm....

How would I do that?
Can it be configured/changed in the ACP?
Would the original PHP.PHP file or other file need editing?
What should I be looking for that may be causing the problem?

Ohh, and is there some way that I can have a message added to every email that says something like, "Do not use 'Reply' to respond to this email. It will not be received by the original sender."?

I'll suggest to my members that they should include their email address in the message itself if they want an email reply.
Hej all, I have the following problem:
MyBB does not send any email from my board at the moment.
The log says:
MyBB was unable to send the email using the PHP mail() function.
I just uploaded the testscript from http://wiki.mybboard.net/index.php/Help:Mail and it works fine, mail is send properly.
Also other Php-Mail applications are working properly.

I tried to follow your guide at the Wiki-Help-Page but I don't have the code
mail($to, $subject, $message, $headers);
in the file inc/functions.php Rolleyes

Please help me, I don't want to mess arround with my codes and cause problems in mailing system.
If you need any file or config just say. The board is: www.zaiendo.de

It's on a freehost but Php Mail is allowed- as said, other php-applications are working just fine.

Best regards
LS 134
(2008-11-04, 11:36 AM)LS 134 Wrote: [ -> ]Hej all, I have the following problem:
MyBB does not send any email from my board at the moment.
The log says:
MyBB was unable to send the email using the PHP mail() function.
I just uploaded the testscript from http://wiki.mybboard.net/index.php/Help:Mail and it works fine, mail is send properly.
Also other Php-Mail applications are working properly.

I tried to follow your guide at the Wiki-Help-Page but I don't have the code
mail($to, $subject, $message, $headers);
in the file inc/functions.php Rolleyes

Please help me, I don't want to mess arround with my codes and cause problems in mailing system.
If you need any file or config just say. The board is: www.zaiendo.de

It's on a freehost but Php Mail is allowed- as said, other php-applications are working just fine.

Best regards
LS 134

http://community.mybboard.net/thread-385...#pid264948
Did you try that yet?
Works Smile
I've read all 5 pages of this, and my system is still stuck.

The script at http://wiki.mybboard.net/index.php/Help:Mail does work, though it uses the default username on my host: HostGator - Linux, which is a totally sucky address to come from.

Using the simplephp.php file, I was able to get a message to come to me ONLY if I send a message to myself as a user e-mail; no notifications work at all.

I have my mail settings set as PHP and I'm at a complete loss for getting to the bottom of it since this works:
<?php
error_reporting(E_ALL);

$to = '[email protected]';

if(mail($to, 'Testing mail', 'This is a mailing test to see if PHP mail works.'))
{
     echo 'Mail was sent by PHP';
}
else
{
     echo 'PHP could not send the mail';
}
?>

Are there any other ideas? Thanks a ton!
Update - Someone else posted a reply and it came through. Duh, I guess that makes sense...

Any idea how to not have it use the hostgator box address? It has our [email protected]
This fixed my problem - Thanks!

I opened the simplephp file attached and had to view page source to get the right code. I then threw it into my html editor made the 2 easy changes taking out the "," at the end of the thread. Uploaded the new file as php.php into my ...inc/mailhandlers directory and BAM! Works like a charm.
Pages: 1 2 3 4 5 6