Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Davey Shafik's Blog:
Mail() without Sendmail on Linux - a Hack
Aug 01, 2005 @ 10:49:47

On Pixelated-Dreams.com, the blog of Davey Shafik, there's this new post today with a look at a quick little hack he threw together for a mutual friend of ours, Amy Hoy, on how to get mail() tro work on linux without sendmail present.

Some time ago, my friend Amy Hoy was working an environment where a higher power disallowed them from installing a mail server on their machine - yet they were using 3rd party software that required the mail() function be available - unless much hacking was to be done.

So, I came up with a solution, thanks to Sara Golemon this will work nicely.

The solution involves commenting out the define for HAVE_SENDMAIL on the system and recompiling PHP. Then you simply define your own mail() function globally in your scripts (using something like PEAR::Mail) and auto_prepend_file that to all of your scripts. Voila - a handy, more or less built in mail() function that works as seamlessly as if it were PHPs own...

tagged:

Link:


Trending Topics: