i will try to describe my problem:
to debug outgoing email in local environment i installed mailcatcher (http://mailcatcher.me/) but faced some problems with catching mails sent from web. if i run the script which contains only one mail() call, everything is fine and i can see the sent email in mailcatcher 127.0.0.1:1080. But when i try to access the same script from the web browser, the mail() function returns false, no any error displayed in browser, nothing in error logs. In mail log even i can see the call for mail() function.
i am not sure, may be my nginx/php-fpm configuration is wrong, or something wrong with permissions.
selinux is disabled.
please help if you know the solution.
Thanks in advance
I faced the same problem on ubuntu 14.04.
/etc/php5/cli/php.ini
and /etc/php5/fpm/php.ini
had the same sendmail_path
configuration but only php-cli
could send emails.
For my environment, Mailcatcher
works on a distant server and I use the catchmail
command to contact it.
Here is the sendmail_path
I used:
sendmail_path = /usr/bin/env catchmail --smtp-ip mailcatcher-ip -f [email protected]
For the fpm
php.ini
file, I had to specify the full path to catchmail
for the mail function to work correctly:
sendmail_path = /usr/bin/env /usr/local/bin/catchmail --smtp-ip mailcatcher -f [email protected]
If you use Mac OS Sierra or later:
here is the right place of catchmail
:
change sendmail_path = /usr/bin/env catchmail -f [email protected]
By sendmail_path = /usr/local/bin/catchmail -f [email protected]
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With