Laravel - How to send email from tinker/cli

Laravel - How to send email from tinker/cli

T

Theodoros Kafantaris

Δημοσιεύτηκε στις July 10, 2024

When I setup my SMTP config in .env file, I want to check immediately if it works.

First of all, I connect to tinker cli.

Code
                    php artisan tinker
                


The easiest way that I found is to execute from tinker the following command.

Code
                    Mail::raw('Hello World!', function($msg) {$msg->to('thkafadaris@atomic.gr')->subject('Test Email'); });
                


That's it. If everything is fine the Test Email will arrive to my inbox!

Ετικέτες

Μοιραστείτε το άρθρο

Προκαλέστε το Μυαλό Σας

NEW!

Κάντε ένα διάλειμμα από το διάβασμα και δοκιμάστε τις ικανότητές σας στη λογική με τον ημερήσιο γρίφο μας!

Τελευταία Πρόκληση: Jul 9, 2026

Daily Logic Ladder - July 9, 2026

Παίξτε τον Σημερινό Γρίφο

Σχετικά με το Blog Μας

Explore where technology meets intellect. From technical tutorials to intellectual exploration—stay curious and inspired.

Ⓒ 2026. Με επιφύλαξη παντός δικαιώματος atomic