Only test mails are sent

Sorry if I come with an old topic maybe…

I have IN installed on a public webspace and it worked very well for years. Now I figured out that I have problems sending mails.

The mail settings in .env and in UI are identical and the test mail from UI works fine. But I am not able to send any other mails. Neither invoice mails nor user invitation mails.

I played around with variuos settings in .env and forced a reload via /update?secret= as I can’t run any commands in CLI. The result stays the same. Only the UI test mails work but nothing more.

I can’t find any logs under storage/logs even with
APP_DEBUG=true
EXPANDED_LOGGING=true

I’m open to every hint. The webserver is running PHP8.2:
image

Hi,

What do you see if you run php -v from the command line?

I don’t have CLI access unfortunately

From the screenshot it looks like the CLI version may be 7.2, if that’s the case it would explain the problem. I suggest emailing your webhost to ask.

Thank you for that hint. I will ask the webhost and keep you updated.

1 Like

I got the reply from the webhoster that it is not possible to set the PHP CLI version generally.

The only option I have is to adjust every PHP call in all scripts and replace php with /usr/bin/php82

If I would know where to change that to get mail to work again I would do that.

Generally it was ideal to have an optional variable in .env auf the PHP path. But this would make it necessary to adjust the scripts that use the PHP CLI.

If you update the cron it should resolve the problem.

Can you give me more details?

Have you configured the cron?

1 Like

Yes I did.

The following script runs minutely:

<?php
echo "Run Cron Job for Invoice Ninja";
exec("cd /www/htdocs/w01xxxx/invoice.fwxxxx.de/ && /usr/bin/php81 -d register_argc_argv=On artisan schedule:run 2>&1", $out, $result);
echo "Returncode: " .$result ."<br>";
echo "Ausgabe des Scripts: " ."<br>";
echo "<pre>"; print_r($out);
?>

I already used php81 there. I can change it to php82 but this doesn’t reflect the info from the screenshot.

The health check won’t be correct however you want to use php82 to support the latest version of Invoice Ninja.

1 Like

Update…

You pointed me in the correct direction. After changing the PHP exec command to “/usr/bin/php82” many mails have been received.

Thank you very much for your support!

Glad to hear it, thanks for the update!

Just the PHP CLI Version is still shown as 7.x but I guess this can be ignored.

image

Yes, that is correct

1 Like