php - sending mail in Laravel 5.4 using Mailgun get error code " 401 UNAUTHORIZED` response: Forbidden " -


i'm trying send mail in laravel 5.4 project mailgun. think set configuration correctly. but, got error message such

clientexception in requestexception.php line 111: client error: post https://api.mailgun.net/v3/sandboxfeb88d58f18841738b2fc81d7cbc7631.mailgun.org/messages.mime >resulted in 401 unauthorized response: forbidden

here configuration:

in .env file

mail_driver=mailgun mailgun_domain=sandboxfeb88d58f18841738b2fc81d7cbc7631.mailgun.org mailgun_secret=pubkey-1767e********** 

in mail.php file

'driver' => env('mail_driver', 'smtp'), 'host' => env('mail_host', 'smtp.mailgun.org'), 'port' => env('mail_port', 587), 'from' => [     'address' => env('mail_from_address', 'richi.htoo@gmail.com'),     'name' => env('mail_from_name', 'richi htoo'), ], 

in services.php file

'mailgun' => [     'domain' => env('mailgun_domain'),     'secret' => env('mailgun_secret'), ], 

and wrote mail sending code in default route such as

route::get('/', function () { //return view('welcome');      $data = [         'title' => 'hi student hope course',         'content' => 'this laravel course created lot of love , dedication you'     ];      mail::send('emails.test', $data, function($message){         $message->to('white.nuzzle@gmail.com', 'white nuzzle')->subject('hello student how you?');     }); }); 

and installed laravel package "guzzlehttp/guzzle" version 6.2 send mail.

but when call default home route, got error message mention above.

i can't find solution error in including forum "stackoverflow.com".

can me please?

personally never got sandbox account work. did little on month ago. sandbox never worked, live account created did. try switching live account , let me know if works you.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -