Current time: 05-24-2012, 12:22 PM Hello There, Guest! (LoginRegister)


PHP mail not sending - Please help
10-24-2008, 01:11 AM (This post was last modified: 07-07-2010 02:47 PM by dcaduser.)
Post: #41
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 22 Hours, 18 Minutes, 5 Seconds ago RE: PHP mail not sending - Please help
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


Attached File(s)
.php  php-old.php (Size: 1.81 KB / Downloads: 81)
Find all posts by this user
10-25-2008, 06:41 AM
Post: #42
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 22 Hours, 18 Minutes, 5 Seconds ago RE: PHP mail not sending - Please help
Oh I see - In your simplephp.php file

PHP Code:
// If safe mode is on, don't send the additional parameters as we're not allowed to
        
if(ini_get('safe_mode') == || 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
Visit this user's website Find all posts by this user
10-25-2008, 01:16 PM (This post was last modified: 10-25-2008 01:23 PM by dcaduser.)
Post: #43
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 22 Hours, 18 Minutes, 5 Seconds ago RE: PHP mail not sending - Please help
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.)


Attached File(s)
.php  simplephp.php (Size: 1.85 KB / Downloads: 222)
.txt  instruct.txt (Size: 218 bytes / Downloads: 254)
Find all posts by this user
10-26-2008, 03:26 AM
Post: #44
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 22 Hours, 18 Minutes, 5 Seconds ago RE: PHP mail not sending - Please help
(10-25-2008 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.

Dennis Tsang :: MyBB Developer
Follow me on Twitter: @dennistt
Visit this user's website Find all posts by this user
10-26-2008, 01:46 PM (This post was last modified: 10-26-2008 01:48 PM by dcaduser.)
Post: #45
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 22 Hours, 18 Minutes, 5 Seconds ago RE: PHP mail not sending - Please help
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.
Find all posts by this user
11-04-2008, 11:36 AM
Post: #46
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 22 Hours, 18 Minutes, 5 Seconds ago RE: PHP mail not sending - Please help
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
PHP 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: http://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

Visit this user's website Find all posts by this user
11-07-2008, 07:37 PM
Post: #47
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 22 Hours, 18 Minutes, 5 Seconds ago RE: PHP mail not sending - Please help
(11-04-2008 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
PHP 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: http://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?

Dennis Tsang :: MyBB Developer
Follow me on Twitter: @dennistt
Visit this user's website Find all posts by this user
11-16-2008, 08:22 PM
Post: #48
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 22 Hours, 18 Minutes, 5 Seconds ago RE: PHP mail not sending - Please help
Works Smile

Visit this user's website Find all posts by this user
12-04-2008, 01:52 AM (This post was last modified: 12-04-2008 01:51 PM by Jesse.)
Post: #49
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 22 Hours, 18 Minutes, 5 Seconds ago RE: PHP mail not sending - Please help
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:
Code:
<?php
error_reporting(E_ALL);

$to = 'my@company.com';

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 username@gator351.hostgator.com
Find all posts by this user
06-05-2009, 06:03 PM
Post: #50
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 22 Hours, 18 Minutes, 5 Seconds ago RE: PHP mail not sending - Please help
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.
Find all posts by this user


Forum Jump:


User(s) browsing this thread: 2 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication