It sounds like you have done all the necessary steps to set up Mailgun, so it's likely that the issue is related to the version of Laravel you are using.
Laravel 8 uses SwiftMailer for sending emails, and as you mentioned, it is now abandoned. You can try to use the Symfony Mailer package instead, as it is the recommended replacement for SwiftMailer. To do this, you will need to update your config/mail.php file.
First, you will need to add the Symfony Mailer package to your composer.json file:
"require": {
...
"symfony/mailer": "^5.1"
},
Then, you will need to update your config/mail.php file to use the Symfony Mailer package instead of SwiftMailer. You can do this by changing the driver option to mailer:
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
],
'mailer' => [
'transport' => 'mailer',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
],
],
Finally, you will need to update your .env file to use the mailer driver instead of smtp:
MAIL_DRIVER=mailer
Once you have done this, you should be able to send emails using Mailgun.