The problem was that
mail() method worked when invoked with
php -r "mail('email@example.com', 'Subject', 'Message'); but when I tried it via the web server (apache in my case), in a php script, no email was sent and the
false. On top of this no error was displayed or logged anywhere not even
error_get_last function did not return anything and I had
error_reporting activated and full
After trying all the possible tests that I could imagine I tried to send an email by executing the
sendmail command form a php script. When I tried php’s
and checked apache’s error logs got the error
sh: /usr/sbin/sendmail: Permission denied. After I got this error it was obvious that the fix was to change the permissions for
/var/qmail/bin/sendmail so that apache can execute them.
Then said to myself:
Happy developing! and that was it.