When I try to send an email from my laravel site I get this error
Swift_TransportException in StreamBuffer.php line 268: Connection could not be established with host lin01.hkdns.co.za [ #0]
all my details is right. my env
MAIL_DRIVER=smtp
MAIL_HOST=lin01.hkdns.co.za
MAIL_PORT=465
MAIL_USERNAME=info@mysite.co.za
MAIL_PASSWORD=password
MAIL_ENCRYPTION=ssl
In my mail.php
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'info@mysite.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'),
],
],
Did I miss something or is this a problem on my server?
Sometime it's possible to be "cache" in the laravel.
Use this command and try again:
If not work, try to restart you xampp.
Another option to check if the problem is with your host or your configuration is to use a Gmail server to send a test email.
Puts this in your
.env
Create or use any gmail account and enable the less secure apps more information here
Source here