0

I have php5 and qmail installed. In php.ini I have configured

sendmail_path = /var/lib/qmail/bin/sendmail

(the path is correct)

However when I am trying to execute the script

<?php mail('my@email.com', 'Test sendmail', 'Body', 'From: my@email.com');

nothing happens, no emails are sent and nothing in the qmail SMTP log (I am getting the logs for any other SMTP activity). Therefore I assume that either PHP is not sending email or somehow I have misconfigured PHP mail. Please advise.

Siarhei
  • 75
  • 1
  • 6
  • Don't use `mail`, use SMTP instead: 1) `mail` is not portable, it might or might not work on another server / installation, etc. 2) using SMTP will guard you a little against blacklisting, etc, as the SMTP server you will be using (probably the one of you internet provider) will be set up more securely. – Bart Friederichs Aug 19 '17 at 09:57

2 Answers2

0

Change the path to sendmail_path = /usr/sbin/sendmail and try again

Malbordio
  • 92
  • 3
  • 4
  • 20
0

Where the sendmail program can be found, usually /usr/sbin/sendmail or /usr/lib/sendmail. configure does an honest attempt of locating this one for you and set a default, but if it fails, you can set it here.

Systems not using sendmail should set this directive to the sendmail wrapper/replacement their mail system offers, if any. For example, qmail users can normally set it to /var/qmail/bin/sendmail or /var/qmail/bin/qmail-inject

Please have a look here for php runtime configuration: http://php.net/manual/fa/mail.configuration.php

Suresh Sapkota
  • 149
  • 3
  • 7