1

UserContorller.php

public function mail(Request $request)
    {

        Mail::send('Email.test', ["customer" => "John Doe"], function ($message) {
            $message->to('abc@gmail.com', 'example_name')->subject('Welcome!');
        });

    }

web.php

$app->get('mail','UserController@mail');

config/mail.php

<?php

return [
    'driver' => "smtp",
    'host' => env('MAIL_HOST=smtp.gmail.com'), // 根据你的邮件服务提供商来填
    'port' => "465", // 同上
    'encryption' => "ssl", // 同上 一般是tls或ssl
    'username' => env('MAIL_USERNAME'),
    'password' => env('MAIL_PASSWORD'),
    'from' => [
        'address' => env('MAIL_FROM_ADDRESS'),
        'name' => env('MAIL_FROM_NAME'),
    ],
];

error in ErrorException in Manager.php line 77:

Missing argument 1 for Illuminate\Support\Manager::createDriver(), called in C:\xampp\htdocs\api\vendor\illuminate\support\Manager.php on line 87 and defined in lumen api.

Sagar Gautam
  • 9,049
  • 6
  • 53
  • 84
falak
  • 77
  • 1
  • 12

1 Answers1

0

if the .env file is correct I suggest removing the composer.lock file and remove the vendor directory and run the composer install again. Maybe the complete package is not installed.

Alihossein shahabi
  • 4,034
  • 2
  • 33
  • 53