Unable to email in laravel


#1

Hello,

I am getting this error whenever i try to send email from my site,
( Expected response code 250 but got code “530”, with message "530-5.5.1 Authentication Required. Learn more at\r\n
530 5.5.1 … )

this is my mail.php in the config folder

‘driver’ => env(‘MAIL_DRIVER’, ‘smtp’),
‘host’ => env(‘MAIL_HOST’, ‘smtp.gmail.com’),
‘port’ => env(‘MAIL_PORT’, 587),

‘from’ => [
‘address’ => env(‘MAIL_FROM_ADDRESS’, ‘myemail@gmail.com’),
‘name’ => env(‘MAIL_FROM_NAME’, myname’),
],
‘encryption’ => env(‘MAIL_ENCRYPTION’, ‘tls’),

‘username’ => env(‘myemail@gmail.com’),

‘password’ => env(‘mypassword’),

any help would be appreciated :slight_smile:


#2

nvm fixed it.

had to write

‘username’ => env(‘MAIL_USERNAME’,‘myemail@gmail.com’)

‘password’ => env(‘MAIL_PASSWORD’,‘mypassword’)


#3

We’re happy the issue has been solved :blush:


#4