Ubuntu – can’t get php mail() working on Ubuntu desktop version with sendmail and postfix

PHPsendmailUbuntu

I'm running Ubuntu 9.10 LAMP and trying to do a simple email test with PHP and I'm not getting any emails sent.

mail("myemail@gmail.com", "eric-linux test", "test") or die("can't send mail"); 

I get no errors from PHP when running that script.

In my php.ini file is:

sendmail_path = /usr/lib/sendmail -t -i

$ sudo ps aux | grep sendmail
eric      2486  0.0  0.4   8368  2344 pts/0    T    14:52   0:00 sendmail -s “Hello world” myemail@gmail.com
eric      8747  0.0  0.3   5692  1616 pts/2    T    16:18   0:00 sendmail
eric      8749  0.0  0.3   5692  1636 pts/2    T    16:18   0:00 sendmail start
eric      9190  0.0  0.3   5692  1636 pts/2    T    19:12   0:00 sendmail start
eric      9192  0.0  0.3   5692  1616 pts/2    T    19:12   0:00 sendmail
eric      9425  0.0  0.3   5692  1620 pts/1    T    19:37   0:00 sendmail
eric      9427  0.0  0.3   6584  1636 pts/1    T    19:37   0:00 sendmail restart
eric      9429  0.0  0.3   5692  1636 pts/1    T    19:38   0:00 /usr/lib/sendmail restart
eric      9432  0.0  0.1   3040   804 pts/1    R+   19:38   0:00 grep --color=auto sendmail

When I run $ sendmail start it just hangs there doing nothing.
I installed postfix also to see if it would help, but it didn't.

I tried to see port 25:

eric@eric-linux:~$ telnet localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 eric-linux ESMTP Postfix (Ubuntu)

thanks

Best Answer

do you really need a full mta installed? i never use sendmail and only have 1 postfix install for all my servers. in all others i use ssmtp. much simpler to configure and more efficient to use, if your server doesn't need to receive emails.