I'm trying to configure MailGun with Flarum, I already set all the values on the settings table, however, when sending a email, this happens:
POST http://mrpowergamerbr.com/forum/api/forgot
{
"errors": [
{
"code": 500,
"title": "Internal server error",
"detail": "exception 'Swift_TransportException' with message 'Connection could not be established with host smtp.mailgun.org [ #0]' in /var/www/mrpowergamerbr/forum/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:265\nStack trace:\n#0 /var/www/mrpowergamerbr/forum/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(62): Swift_Transport_StreamBuffer->_establishSocketConnection()\n#1 /var/www/mrpowergamerbr/forum/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(113): Swift_Transport_StreamBuffer->initialize(Array)\n#2 /var/www/mrpowergamerbr/forum/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(79): Swift_Transport_AbstractSmtpTransport->start()\n#3 /var/www/mrpowergamerbr/forum/vendor/illuminate/mail/Mailer.php(395): Swift_Mailer->send(Object(Swift_Message), Array)\n#4 /var/www/mrpowergamerbr/forum/vendor/illuminate/mail/Mailer.php(181): Illuminate\\Mail\\Mailer->sendSwiftMessage(Object(Swift_Message))\n#5 /var/www/mrpowergamerbr/forum/vendor/illuminate/mail/Mailer.php(133): Illuminate\\Mail\\Mailer->send(Array, Array, Object(Closure))\n#6 /var/www/mrpowergamerbr/forum/vendor/flarum/core/src/Core/Command/RequestPasswordResetHandler.php(93): Illuminate\\Mail\\Mailer->raw('Hey MrPowerGame...', Object(Closure))\n#7 [internal function]: Flarum\\Core\\Command\\RequestPasswordResetHandler->handle(Object(Flarum\\Core\\Command\\RequestPasswordReset))\n#8 /var/www/mrpowergamerbr/forum/vendor/illuminate/bus/Dispatcher.php(203): call_user_func(Array, Object(Flarum\\Core\\Command\\RequestPasswordReset))\n#9 [internal function]: Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}(Object(Flarum\\Core\\Command\\RequestPasswordReset))\n#10 /var/www/mrpowergamerbr/forum/vendor/illuminate/pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Flarum\\Core\\Command\\RequestPasswordReset))\n#11 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Flarum\\Core\\Command\\RequestPasswordReset))\n#12 /var/www/mrpowergamerbr/forum/vendor/illuminate/pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(Flarum\\Core\\Command\\RequestPasswordReset))\n#13 /var/www/mrpowergamerbr/forum/vendor/illuminate/bus/Dispatcher.php(204): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))\n#14 /var/www/mrpowergamerbr/forum/vendor/illuminate/bus/Dispatcher.php(177): Illuminate\\Bus\\Dispatcher->dispatchNow(Object(Flarum\\Core\\Command\\RequestPasswordReset), NULL)\n#15 /var/www/mrpowergamerbr/forum/vendor/flarum/core/src/Api/Controller/ForgotPasswordController.php(51): Illuminate\\Bus\\Dispatcher->dispatch(Object(Flarum\\Core\\Command\\RequestPasswordReset))\n#16 /var/www/mrpowergamerbr/forum/vendor/flarum/core/src/Http/GenerateRouteHandlerTrait.php(35): Flarum\\Api\\Controller\\ForgotPasswordController->handle(Object(Zend\\Stratigility\\Http\\Request))\n#17 /var/www/mrpowergamerbr/forum/vendor/flarum/core/src/Http/Middleware/DispatchRoute.php(67): Flarum\\Api\\ApiServiceProvider->Flarum\\Http\\{closure}(Object(Zend\\Stratigility\\Http\\Request), Array)\n#18 [internal function]: Flarum\\Http\\Middleware\\DispatchRoute->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#19 /var/www/mrpowergamerbr/forum/vendor/zendframework/zend-stratigility/src/Dispatch.php(81): call_user_func(Object(Flarum\\Http\\Middleware\\DispatchRoute), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#20 /var/www/mrpowergamerbr/forum/vendor/zendframework/zend-stratigility/src/Next.php(113): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#21 /var/www/mrpowergamerbr/forum/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(32): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#22 [internal function]: Flarum\\Api\\Middleware\\FakeHttpMethods->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#23 /var/www/mrpowergamerbr/forum/vendor/zendframework/zend-stratigility/src/Dispatch.php(81): call_user_func(Object(Flarum\\Api\\Middleware\\FakeHttpMethods), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#24 /var/www/mrpowergamerbr/forum/vendor/zendframework/zend-stratigility/src/Next.php(113): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#25 /var/www/mrpowergamerbr/forum/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(30): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#26 [internal function]: Flarum\\Http\\Middleware\\ParseJsonBody->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#27 /var/www/mrpowergamerbr/forum/vendor/zendframework/zend-stratigility/src/Dispatch.php(81): call_user_func(Object(Flarum\\Http\\Middleware\\ParseJsonBody), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#28 /var/www/mrpowergamerbr/forum/vendor/zendframework/zend-stratigility/src/Next.php(113): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#29 /var/www/mrpowergamerbr/forum/vendor/flarum/core/src/Api/Middleware/AuthenticateWithHeader.php(50): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#30 [internal function]: Flarum\\Api\\Middleware\\AuthenticateWithHeader->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#31 /var/www/mrpowergamerbr/forum/vendor/zendframework/zend-stratigility/src/Dispatch.php(81): call_user_func(Object(Flarum\\Api\\Middleware\\AuthenticateWithHeader), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#32 /var/www/mrpowergamerbr/forum/vendor/zendframework/zend-stratigility/src/Next.php(113): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#33 /var/www/mrpowergamerbr/forum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithCookie.php(42): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#34 [internal function]: Flarum\\Http\\Middleware\\AuthenticateWithCookie->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#35 /var/www/mrpowergamerbr/forum/vendor/zendframework/zend-stratigility/src/Dispatch.php(81): call_user_func(Object(Flarum\\Http\\Middleware\\AuthenticateWithCookie), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#36 /var/www/mrpowergamerbr/forum/vendor/zendframework/zend-stratigility/src/Next.php(113): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#37 /var/www/mrpowergamerbr/forum/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(75): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#38 /var/www/mrpowergamerbr/forum/vendor/zendframework/zend-diactoros/src/Server.php(166): Zend\\Stratigility\\MiddlewarePipe->__invoke(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Diactoros\\Response), NULL)\n#39 /var/www/mrpowergamerbr/forum/vendor/flarum/core/src/Http/AbstractServer.php(33): Zend\\Diactoros\\Server->listen()\n#40 /var/www/mrpowergamerbr/forum/api.php(16): Flarum\\Http\\AbstractServer->listen()\n#41 {main}"
}
]
}
I think the solution is very obvious, but I can't find what I'm doing wrong.