0

I’m facing a special situation : the php mail(); functions works when I use a cli script, but it succeeds without sending anything (it just returns true) when I’m running it on the website through appache. My php.ini files are all identical.

I know sendmail command (msmtp) can sometimes fails while steel returning successfully (it says so through a message on stdout). So how I can get the stdout created by msmstp through php in apache2 ?

user2284570
  • 2,891
  • 3
  • 26
  • 74
  • Of course, in the current situation, it’s hard to know what’s wrong. I’m thinking about file permissions problem, but it’s not`.msmtprc` – user2284570 Dec 28 '17 at 23:51
  • 1
    Have you looked at the server logs? The only thing you can get out of `mail()` is the boolean return code. If you want anything more you're going to want to either patch it in and custom compile PHP, or just not use `mail()` and issue the command directly. – Sammitch Dec 29 '17 at 01:15
  • @Sammitch : everything is empty concerning the logs. But as I said, the problem is it works when I call mail directly through cli, but when I call it directly in the same way through the same script under apache, the e‑mail isn’t received. – user2284570 Dec 29 '17 at 01:31

0 Answers0