I'm trying to create a contact form using laravel 5.4 and I added my server email details to the .env and the mail.php but I'm getting this error
Swift_TransportException in AbstractSmtpTransport.php line 383: Expected response code 250 but got code "421", with message "421 Unexpected failure, please try later "
If I try this and I use mailtrap it works fine.
This is my mail.php
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'info@website.co.za'),
'name' => env('MAIL_FROM_NAME', 'Info'),
],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];
My .env file
MAIL_DRIVER=smtp
MAIL_HOST=hosting.com
MAIL_PORT=587
MAIL_USERNAME=info@website.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=