Skip to main content
Maher Sakka
Main navigation
  • Home
  • Contact me
Language switcher
Breadcrumb
  1. Home
  2. Blog
  3. How To Check If Email Are Sent Correctly In a Laravel Project

How to check if email are sent correctly in a Laravel Project

You can you use tinker to check if email are sent correctly in a Laravel project.

Launch Tinker using this command

php artisan tinker

The shell is launched

Psy Shell v0.12.9 (PHP 8.2.4 — cli) by Justin Hileman
>

Now add the following code:

Mail::raw('This is an email test! Please confirm receipt.', function ($message) {
	$message->to('[email protected]')
	 ->subject('Laravel email test');
});

If it's OK, a message like this will be shown:

= Illuminate\Mail\SentMessage {#7055}

Otherwise an exception will rise with the reason. ex:

 Symfony\Component\Mailer\Exception\TransportException:Connection could not be established with host "135.45.15.32:25": stream_socket_client(): Unable to connect to 135.45.15.32:25
Tags
  • Laravel
Related posts
  • How to reset a User password in a Laravel project from console
  • Fix the problem of Please provide a valid cache path in Laravel
Tags
  • Laravel
  • Linux
  • Drupal
  • Database
  • Tips & Tricks
  • Mobile
Recent posts
  • How to reset a User password in a Laravel project from console
  • How to check if email are sent correctly in a Laravel Project
  • How to Find Recently Modified Files in Linux
Monthly archive
  • May 2017 (2)
  • August 2018 (1)
  • October 2020 (1)
  • August 2023 (1)
  • July 2024 (2)
  • November 2024 (1)
  • July 2025 (10)
  • October 2025 (2)
Projects
  • elmanager.tn
  • 365mathex.com
  • vpop.tn
  • toufoula.tn
  • writethemoney.com
  • dinartunisien.com
RSS feed

mahersakka.com © 2024