0

I've never configured a Laravel mail settings before. On development, you know, it works but on production, I'm getting internal error 500.

In my mail controller, this is giving the error:

[..]

Mail::to($toEmail)->send(new Support($support));

I've looked in storage/logs/ and no logs are there. I now assume I'm missing a php module? My .env: MAIL_DRIVER=smtp

Im using Ubuntu 18 with php 7.2 and nginx.

Also, why am I not seeing the log files?

Thanks

Sylar
  • 11,422
  • 25
  • 93
  • 166
  • Have you tried checking the usual log folder for your webserver, like `/var/log/apache2`, for error logs? – Nico Haase Jan 16 '20 at 13:01
  • Apache? No. Im using Nginx. Nothing is in either access.log or error.log. – Sylar Jan 16 '20 at 13:02
  • Additionally, what have you tried to debug the problem? Have you checked all mail configuration? Is this happening on all recipient addresses? Does it work using other mail servers? – Nico Haase Jan 16 '20 at 13:02
  • 1
    usually production logs in /var/logs/* check apache/nginx error logs and php too, you should include logs or at least a clear error message/ – ROOT Jan 16 '20 at 13:03
  • @NicoHaase I have not tried others. I shall do that now. – Sylar Jan 16 '20 at 13:04
  • Have you tried setting your application to `dev` mode? Using Symfony, this prints all error messages instead of throwing a 500 error – Nico Haase Jan 16 '20 at 13:04
  • Just tried with `smtp.googlemail.com` and same error. local dev can send email. – Sylar Jan 16 '20 at 13:21
  • Though the mail commands were generated in a docker container but those files are in git. – Sylar Jan 16 '20 at 13:22
  • Found this issue. Ive made changes to the `.env` file using `sudo` and that messed things up so I had to `chown -R www-data:www-data` the root dir. Thanks all! – Sylar Jan 16 '20 at 16:13
  • What is the specific error shown in laravel's log? – IGP Jan 16 '20 at 16:48
  • No error. That was the pain point. It seems that the log folder was able to be written to. – Sylar Jan 16 '20 at 16:49

0 Answers0