Skip to content
Advertisement

Laravel 7 internal server error 500 when sending email

I’m having some trouble with sending email using laravel. I’ve looked around the stackoverflow for solutions but none worked so far. Here’s my env and code so far.

JavaScript

and this is my mail.php file

JavaScript

Now this is my code. It’s just a simple to test the email function. This is the class created in mail folder

JavaScript

and this is the route called

JavaScript

the route works if i commented out the Mail to line. any suggestions? I’ve been at it for hours.

Advertisement

Answer

In your mail class you are accessing a properties property which does not exist.

Rather in your mailable constructor do something like

JavaScript

This is for sure one issue. As laravel will throw an unknown property error.

P.s. make sure your env has debug as true if you are not seeing errors in your logs.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement