PHP mail() is not working, need help setting up exim4

5,098

Interesting, dialog appears to be broken on your system for some reason. Try

dpkg-reconfigure -freadline exim4-config

Can you send email from the terminal (eg mail [email protected] -s "subject goes here" then entering an email body ending with a . on a line by itself)? Is /usr/sbin/sendmail/ a typo, or do you really have a / on the end, because that shouldn't be there.

Share:
5,098

Related videos on Youtube

Strawberry
Author by

Strawberry

I love programming, and I'm trying to get better!

Updated on September 17, 2022

Comments

  • Strawberry
    Strawberry almost 2 years

    I have the symbolic link setup for /usr/sbin/sendmail which points to my exim directory /usr/sbin/exim4/ and my php.ini pointing to /usr/sbin/sendmail. My mail isn't sending. I don't know what to do, but when I tried to reconfigure, it just shows the gui and goes straight to the next bash line with twomuchwork:~# 1;2c1;2c1;2c.

    Update: I checked my iptables to make sure 25 was open. I think it might have something to do with google apps. At this point, I just want to be able to use Google apps and send mail using PHP's mail(). I have some web applications that requires the mail(). I even tried this post: How to Setup Ubuntu Mail Server with Google Apps?

    Update2: I tried almost everything out there. I tried setting up exim4 as smarthost, I tried sendmail, everything works when I send a e-mail to my @gmail.com from terminal, but I still cannot get my PHP mail() to work.

  • Strawberry
    Strawberry over 13 years
    It works when I send it from the terminal, but not from php.
  • DerfK
    DerfK over 13 years
    What does exim's log show when you try sending from PHP?
  • Strawberry
    Strawberry over 13 years
    I only see a mainlog in /var/log/exim4 and it doesn't say anything significant there. Just says 2010-10-31 20:09:08 Start queue run: pid=6389 2010-10-31 20:09:08 End queue run: pid=6389
  • Strawberry
    Strawberry over 13 years
    For the record, I don't think this problem is related to PHP; I am saying I cannot send mail with PHP because of a reason I don't know of. I can provide details if I knew what to provide; I said I do not know what to do, and I hope to get help and direction here. With that said, I am trying to send using a foo.php using the mail() of PHP. Also, this is the command I used echo "This is a test." | mail -s Testing [email protected] from this guide: library.linode.com/email/exim/send-only-mta-debian-5-lenny
  • symcbean
    symcbean over 13 years
    The "mail" command is not how PHP sends mail. However its worth checking what happens when you try to exec this from PHP. Your ini file should contain something like 'sendmail_path = /usr/sbin/sendmail -t '. You need to check that the binary is where its supposed to be and that it reads the envelope from the headers supplied in the message on stdin.