Swift_TransportException in StreamBuffer.php line 269 Connection could not be established with host Name or service not known #0]

Posted 2 years ago by zainabid3108

I am new to Laravel and I am using Laravel 5.0 in one of my application and I am trying to send an email via smtp in Larvel but I am getting this awkward error everytime, It is also not getting my host, Cannot paste whole error in title so here it is

Connection could not be established with host [php_network_getaddresses: getaddrinfo failed: Name or service not known #0]

My .env file code: MAIL_DRIVER=smtp MAIL_HOST=mail.brownrice.com MAIL_PORT=587 MAIL_USERNAME=cannot show user due to security MAIL_PASSWORD=cannot show pass due to security

My app/mail.php

'driver' => env('MAIL_DRIVER', 'smtp'), 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 'port' => env('MAIL_PORT', 587), 'from' => ['address' => '[email protected]', 'name' => 'Rezosystems'], 'encryption' => 'tls', 'username' => env('MAIL_USERNAME'), 'password' => env('MAIL_PASSWORD'), 'sendmail' => '/usr/sbin/sendmail -bs', 'pretend' => false,

My MailController

Mail::send('EmailTemplates/test_email', ['msg' => 'Congratulations!!! Your first email template sent'], function($message) { $message->to('[email protected]', 'John Doe')->subject('Test!'); });

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.