I'm trying to setup a Debian Lenny box to be used for web development. It's running the standard PHP5, Apache2, and MySQL5. I've been trying to get it so that I can use the PHP mail() function to send out email... but I haven't been successful. Does anyone know of a good tutorial that tells you what needs to be installed and how to configure it? Thanks for the help.

link|improve this question

43% accept rate
feedback

1 Answer

up vote 1 down vote accepted

Sendmail is a requirement for the PHP mail() function on Linux, maybe check the logs in /var/log/ to see what what might be going wrong if you already have it installed. Here is a tutorial on setting up sendmail with debian.

Your other alternative if you want to use a different SMTP server is to use a different library. See this serverfault post for other options along these lines.

link|improve this answer
Apparently you can also use ssmtp, which might be simpler: davidhurst.co.uk/2007/06/19/php-mail-and-ssmtp-on-debian-linux – Kyle Brandt Jul 28 '09 at 17:39
it doesn't need to be Sendmail. Any mainstream MTA on Linux will provide a sendmail comparible binary. We use Exim with no trouble. – David Pashley Jul 28 '09 at 17:39
Also, really, really really don't install sendmail. Exim or Postfix are much saner choices these days. – David Pashley Jul 28 '09 at 17:40
Will he have to make any changes to 'sendmail_path =' in the php.ini with exim? – Kyle Brandt Jul 28 '09 at 17:48
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.