0

Possible Duplicate:
Troubleshooting PHP Mail

I can't seem to get mail using PHP's mail() function. I am working on my client's dev server, which is running a version of Ubuntu. I installed sendmail using the following command: apt-get install sendmail. After that I went to the php.ini file in /etc/php5/apache2/ and took out the comment for sendmail_path and set it to /usr/sbin/sendmail -i -t. Despite this, I'm still not getting any mail.

Community
  • 1
  • 1
Anonymous
  • 1
  • 1

1 Answers1

2

It's quite likely that sendmail itself is not set up correctly. Can you receive a test message sent with the sendmail command? E.g.: echo "test message" | sendmail -s "test message" your-email@your-domain.com

Daniel Lyons
  • 22,421
  • 2
  • 50
  • 77
  • you stole my answer! but before you do anything check if sendmail is actually sending mail to outside word rather than spooling them back on the box – Kumar Aug 09 '11 at 17:15
  • 1
    No, I'm not getting anything at all. – Anonymous Aug 09 '11 at 17:42
  • Uh, so what's next. Obviously sendmail is not set up correctly. I'm bot well-versed in Linux, so I'm not sure how to proceed to ensure that it is set up correctly. – Anonymous Aug 09 '11 at 18:43
  • Unfortunately, setting up sendmail is a lot of work. I would recommend you try and set up [msmtp](http://msmtp.sourceforge.net/) or [ssmtp](http://www.linux.com/archive/feature/132006) instead. If you really need a full-blown MTA, I would recommend using [Postfix](http://www.postfix.org/) instead. – Daniel Lyons Aug 09 '11 at 18:52
  • Thanks. If I use ssmtp or postfix will I have to remove the sendmail package from the server? – Anonymous Aug 09 '11 at 19:20