{"action":"closed","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/8654","labels_url":"https://api.github.com/repos/laravel/framework/issues/8654/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/8654/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/8654/events","html_url":"https://github.com/laravel/framework/issues/8654","id":74071884,"number":8654,"title":"Mail::send(), content were being posted before the authentication was attached","user":{"login":"etiennemarais","id":4479918,"avatar_url":"https://avatars.githubusercontent.com/u/4479918?v=3","gravatar_id":"","url":"https://api.github.com/users/etiennemarais","html_url":"https://github.com/etiennemarais","followers_url":"https://api.github.com/users/etiennemarais/followers","following_url":"https://api.github.com/users/etiennemarais/following{/other_user}","gists_url":"https://api.github.com/users/etiennemarais/gists{/gist_id}","starred_url":"https://api.github.com/users/etiennemarais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etiennemarais/subscriptions","organizations_url":"https://api.github.com/users/etiennemarais/orgs","repos_url":"https://api.github.com/users/etiennemarais/repos","events_url":"https://api.github.com/users/etiennemarais/events{/privacy}","received_events_url":"https://api.github.com/users/etiennemarais/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-07T17:50:24Z","updated_at":"2015-05-31T18:11:02Z","closed_at":"2015-05-31T18:11:02Z","body":"According to SendGrid's docs for Laravel Integration, they recommend the following settings:\r\n\r\nreturn array( 'driver' => 'smtp', 'host' => 'smtp.sendgrid.net', 'port' => 587, 'from' => array('address' => 'from@example.com', 'name' => 'John Smith'), 'encryption' => 'tls', 'username' => 'sendgrid_username', 'password' => 'sendgrid_password', );\r\n?>\r\n\r\nHere's the code snippet they provide for testing email:\r\n\r\nMail::send('emails.demo', $data, function($message) { $message->to('jane@example.com', 'Jane Doe')->subject('This is a demo!'); });\r\n?>\r\n\r\nI was receiving 500 Status errors. However I could connect using telnet and was authenticated. It turned out my emails were being posted before the authentication was attached. My Authentication credentials were set up in the .env file like they are supposed to be. In order to get the 200 Status Success messages I had to hardcode my username and password into the config/mail.php file.\r\n\r\nIs there a way around this? I wouldn't want to explicitly code the authentication information in the config/mail.php file. Isn't that the whole point in placing it in the .env file? I was wondering why the authentication info was arriving last, which SendGrid told me was causing them to respond with a 550 error."}}