私はLaravelメールクラスを経由してメールを送信しようとすると、私は次のエラーを取得する:Laravelメール:Swift_Transport_EsmtpTransportを機能させる引数が少なすぎます:: __構築物()
Symfony \ Component \ Debug \ Exception \ FatalThrowableError
(E_RECOVERABLE_ERROR) Type error: Too few arguments to function Swift_Transport_EsmtpTransport::__construct(), 0 passed in /[...]/CustomerCenter/database/factories/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php on line 37 and at least 3 expected
私はPHPを使用してメールのクラスを作成しました職人さんは:mailに連絡し、メールアドレスにブレードビュー '連絡先'を作成し、web.phpルートファイルで呼び出されたコントローラを作成しました。私はメールのクラスを呼び出す際に使用する設定::( 'メール')を取得コントローラファイルで
array:9 [▼
"driver" => "smtp"
"host" => "xxx.kasserver.com"
"port" => "25"
"from" => array:2 [▼
"address" => "[email protected]"
"name" => "Example"
]
"encryption" => null
"username" => "xxx"
"password" => "***"
"sendmail" => "/usr/sbin/sendmail -bs"
"markdown" => array:2 [▼
"theme" => "default"
"paths" => array:1 [▼
0 => "/[...]/resources/views/vendor/mail"
]
]
]
-
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class Contact extends Mailable {
use Queueable, SerializesModels;
/**
* Create a new message instance.
*
*/
public function __construct() {
//
}
/**
* Build the message.
*
* @return $this
*/
public function build() {
return $this->view('emails.contact');
}
}
これは私の電子メールの設定です:
Contactクラスは次のようになりますこの方法:私はすでにそれらの質問を確認
\Mail::to('[email protected]')->send(new Contact);
:
Too few arguments to function Db::__construct(), 0 passed in
Laravel: Too few arguments to function Illuminate\Support\Manager::createDriver()
私はすでに実行:
- PHPの職人の設定:明確な
- PHPの職人ベンダー:公開
私は混乱している、私はこのチュートリアル動画で説明した同じでした: /ではSwiftMailer データベース/工場/ベンダーが、それは持っている必要があります。 https://laracasts.com/series/laravel-from-scratch-2017/episodes/26