6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Laravel tinkerコマンドでメール送信する

Posted at

Laravelのartisanコマンドのtinkerコマンドでメール送信する方法。
(事前に、Laravelの環境設定 .envファイルに、smtpサーバの設定が必要です。)

プロジェクトディレクトリの中で、次のartisanコマンドを実行すると、tinkerの対話型シェルが立ち上がる。

php artisan tinker

以下記述を実行して、nullが返れば送信完了。

>>> Mail::raw('メール本文', function($message) { $message->to('mail@example.com')->subject('メールタイトル'); });

参考

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?