mail() just stopped working!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gnu2tux
Forum Newbie
Posts: 2
Joined: Sat Mar 18, 2006 9:23 am

mail() just stopped working!

Post by gnu2tux »

Hi,

I am running Debian 3.1 on my servers with PHP4, and a couple of weeks ago all my scripts (and other sites that use the mail() function just stopped working).

For example - phpbb gives a mailer.php error, which I thought may just be PHPbb specific, but then I started noticing today that all the scripts I have tidied away for only my access which are very basic, suddenly don't work.

There is no error coming back from php when the mail function is called in the browser, and I can't see any annoucements on php.net for feature change, the only changes that could have been made to my servers would have been debian security updates.

Today I broke it down to it's most simplest:

<?
mail ('myaddress@mydomain.net','Hi','blah','sendersaddress@somedomain.net');
?>

I saved it as mailer.php and executed it from my browser. No errors, no nothing. I checked the mail logs, nothing came from the webserver mailwise, so it's not like anti-spam/virus is messing it up.

This all worked perfectly a few weeks ago or less. Any ideas why all of a sudden it's broken? I rely on the mail() function for many websites.

:(

Al.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Did your host change some settings? Have you tried using a SMTP server as the sending route?
gnu2tux
Forum Newbie
Posts: 2
Joined: Sat Mar 18, 2006 9:23 am

Post by gnu2tux »

thanks for getting back in touch.

I installed php4-cli to test the mailer.php script and it came back with a postfix error.

Turns out that the security hardening I did a couple of weeks ago is to blame!

My bad.

Thanks for helping out -- btw do you think that using SMTP instead is a better idea? If so why?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

SMTP, in my experience, gives less problems trying to get working than through other means. I find it is faster to send the mails too.
Post Reply