Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

sendmail and php

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
wolfric
Posts: 10
Joined: 2010-03-27 03:10

sendmail and php

#1 Post by wolfric »

I'm trying to get sendmail to work with php but i can't even seem to get it to work on it's own. I'm logged in as root (su root). I have in php.ini:
commented out smpt and smtp port (win 32 only it says) and sendmail_from commented out

For unix only
sendmail_path=/usr/lib/sendmail

sendmail seems to be installed i can run it from bash. I try sending an email using:
sendmail example@whatever.com
message
ctrl + D

which i saw somewhere however the email doesn't seem to go through. I've also tried (after restarting apache server) to use mail() php function and that also doesn't work. Any ideas?

User avatar
naithen
Posts: 212
Joined: 2008-03-03 15:33

Re: sendmail and php

#2 Post by naithen »

wolfric wrote:sendmail_path=/usr/lib/sendmail
Did you miss -t -i options?

Code: Select all

sendmail_path = /usr/lib/sendmail -t -i
Did you make sure that /usr/lib/sendmail is actually where sendmail is?

Code: Select all

$ whereis sendmail
sendmail: /usr/sbin/sendmail /usr/lib/sendmail /usr/share/man/man8/sendmail.8.gz
Most of the time it is another MTA that provides sendmail function. On a default debian lenny installation exim4 does this. So check for your MTA is working properly.

Code: Select all

$ ls -l /usr/sbin/sendmail
lrwxrwxrwx 1 root root 5 2009-04-07 15:53 /usr/sbin/sendmail -> exim4
If all fails follow this guide; http://www.squad17.org/node/39 to relay your mail to a mail server using ssmtp.

User avatar
naithen
Posts: 212
Joined: 2008-03-03 15:33

Re: sendmail and php

#3 Post by naithen »

Just found this as well

User avatar
lbm
Posts: 494
Joined: 2009-05-16 09:24
Location: Denmark

Re: sendmail and php

#4 Post by lbm »

Are you sending to an external recipient?
It could be that your ISP is blocking SMTP traffic. If so you must configure the mailer daemon to use a relay server.

Post Reply