I set up my mailgun account and was trying to use the sandbox domain to test sending email using API and not smtp. This is how my Laravel .env file was set up
MAIL_MAILER=mailgun
MAILGUN_DOMAIN=sandboxxxxxxx.mailgun.org
MAILGUN_SECRET=xxxxxxxxx
MAILGUN_ENDPOINT=api.mailgun.net/v3/<mailgun-domain>
Then I was using this in my controller to send the email.
$emailToSendTo = Page::where('name', 'contact')->first()->email;
Mail::to($emailToSendTo)->send(new ContactSent($request));
My email is not being sent as I look into the mailgun dashboard. I am also not getting any error message. Also I know that mailgun restricts the emails you can send to in the sandbox domain to what you set up in mailgun. The $emailToSendTo is a verified email.
The ContactSent class has been set up fine with the blade view.