Emails not sending

Yes, that’s the best way.

I am having the exact same problem on self hosted - the test email sends fine, email and invoice and it says sent successfully however it doesn’t send.

I have ran all the commands from above

$php artisan tinker
>>>env(‘parameter_name’);
= NULL

$php artisan config:cache
>Configuration cache cleared!
>Configuration cached successfully!

$php artisan config:clear
>Configuration cache cleared!

Logged out and logged back in, back to invoice and email goes through and says sent successfully however it doesn’t go.

I’m running LAMP stack on a (raspbian stretch) on an rpi3, using php version 7.0.

I’m probably at my limit for checking on possible causes, if you think of anything I can try please let me know.

Cheers Cory.

Have you checked for any errors in storage/logs/laravel-error.log

Hi Hillel,

There was only 2 or 3 timeouts for the mail server so I’m not sure where all the other emails went…

I think the issue may have something to do with my web hosting providers email settings, as I plugged my ISP email credentials and it seems to work fine with them.

I’m not even sure who I would contact to see the logs on my web host’s end…

You can also see the error in the app when logged in by viewing /errors

@ccall48
I’ve be grateful to hear if you find a solution to this.

I was not able to, which is rather annoying, as it makes Invoice Ninja rather useless as an automated invoicing system.

By the way… is your server stack a Bitnami stack, by chance?

Cheers,

Jonathan

Hillel,

I am seeing these errors (using the /errors view)

[2018-07-19 08:00:02] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/cache/eb/de/ebdea3620f4144a57de2a68a23251f5df5b471a7): failed to open stream: Permission denied {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","user_agent":"","locale":"en","ip":"52.175.232.124","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"/"} []

[2018-07-18 08:00:01] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/cache/eb/de/ebdea3620f4144a57de2a68a23251f5df5b471a7): failed to open stream: Permission denied {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","user_agent":"","locale":"en","ip":"52.175.232.124","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"/"} []

[2018-07-17 08:00:02] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/cache/eb/de/ebdea3620f4144a57de2a68a23251f5df5b471a7): failed to open stream: Permission denied {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","user_agent":"","locale":"en","ip":"52.175.232.124","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"/"} []

[2018-07-16 08:00:02] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/cache/eb/de/ebdea3620f4144a57de2a68a23251f5df5b471a7): failed to open stream: Permission denied {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","user_agent":"","locale":"en","ip":"52.175.232.124","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"/"} []

[2018-07-15 08:00:01] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/cache/eb/de/ebdea3620f4144a57de2a68a23251f5df5b471a7): failed to open stream: Permission denied {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","user_agent":"","locale":"en","ip":"52.175.232.124","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"/"} []

[2018-07-14 08:00:02] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/cache/eb/de/ebdea3620f4144a57de2a68a23251f5df5b471a7): failed to open stream: Permission denied {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","user_agent":"","locale":"en","ip":"52.175.232.124","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"/"} []

[2018-07-13 11:23:32] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/sessions/X8cwQ3jtoFgFCE9Zfm9JRjZbn9cf0CQmbw0vOtod): failed to open stream: Permission denied {"context":"PHP","user_id":1,"account_id":1,"user_name":"Jonathan Evatt","method":"GET","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:61.0) Gecko/20100101 Firefox/61.0","locale":"en","ip":"122.57.248.122","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"api/invoices"} []

[2018-07-13 11:23:31] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/sessions/X8cwQ3jtoFgFCE9Zfm9JRjZbn9cf0CQmbw0vOtod): failed to open stream: Permission denied {"context":"PHP","user_id":1,"account_id":1,"user_name":"Jonathan Evatt","method":"GET","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:61.0) Gecko/20100101 Firefox/61.0","locale":"en","ip":"122.57.248.122","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"invoices"} []

[2018-07-13 11:22:12] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/sessions/X8cwQ3jtoFgFCE9Zfm9JRjZbn9cf0CQmbw0vOtod): failed to open stream: Permission denied {"context":"PHP","user_id":1,"account_id":1,"user_name":"Jonathan Evatt","method":"GET","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:61.0) Gecko/20100101 Firefox/61.0","locale":"en","ip":"122.57.248.122","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"invoices/17/edit"} []

[2018-07-13 11:22:11] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/sessions/X8cwQ3jtoFgFCE9Zfm9JRjZbn9cf0CQmbw0vOtod): failed to open stream: Permission denied {"context":"PHP","user_id":1,"account_id":1,"user_name":"Jonathan Evatt","method":"PUT","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:61.0) Gecko/20100101 Firefox/61.0","locale":"en","ip":"122.57.248.122","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"invoices/17"} [] 

Looks like there are permissions errors.

What are the correct file and folder permissions for InvN?

@inspirednz

It works with my isp smtp ssl email settings, just not my domain web host who hosts my FQDN - which I don’t exactly understand why yet as no error logs on my end flag a problem - if I hosted the site with them the sendmail option would probably work through their server however I’m currently running invoice ninja in parallel with my current system to see if it is beneficial to change over.

I’m not using a bitnami stack, I’m using LAMP stack (Linux, Apache2, Mysql/MariaDB, PHP) directly on one of my raspberry pi 3’s.

I’m not a macintosh user which it looks like you are? It looks like you’re having a few problems there looking at your error logs above make sure your ninja files and folders are all owned by the web server with I think it was permissions of 755. Check the link below for for information on permissions.

https://invoice-ninja.readthedocs.io/en/latest/install.html

I don’t know how computer proficient you are but failing that, can you back up your database and try a docker version?

I had same issue on self hosted v4.5.5 Log was showing email sent however there was no email received. Changed the following: System Settings > Email Settings > from Sendmail to Mail and I was able to send emails again. I hope this helps someone.

Did you guys have any luck figuring this out?

Still having the exact same issue.
All recurrent invoices remain as Draft

Have you enabled proc_open?

Did you guys have any luck figuring this out?

Still having the exact same issue.
All recurrent invoices remain as Draft

No, I never managed to resolve this. Sadly.

Have you enabled proc_open?

I couldn’t say. I’ll look into how I go about doing that.

if you want we can take a look. make sure you have the access to your hosting account and ability to read logs.

  1. Mail server log
  2. Webserver log

that would mean having webhosting console access.

In case someone else stumbles upon this: I was having the same issue. When I sent a test email in the system settings (using SMTP configuration), everything was working correctly, but recurring invoices wouldn’t send, although the log said “billed successfully”. Recurring invoices would stay in the draft state.

The thing was that I disabled the automatic sending of recurring invoices in the invoice settings > invoice workflow. Once I enabled this, it worked perfectly.