sendmail and php

New to Debian (Or Linux in general)? Ask your questions here!

sendmail and php

Postby wolfric » 2010-03-27 03:18

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?
wolfric
 
Posts: 10
Joined: 2010-03-27 03:10

Re: sendmail and php

Postby naithen » 2010-04-14 15:26

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: 213
Joined: 2008-03-03 15:33

Re: sendmail and php

Postby naithen » 2010-04-14 16:02

Just found this as well
User avatar
naithen
 
Posts: 213
Joined: 2008-03-03 15:33

Re: sendmail and php

Postby lbm » 2010-04-14 17:40

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.
User avatar
lbm
 
Posts: 494
Joined: 2009-05-16 09:24
Location: Denmark


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable