From 1bbc5a1639ce4ce5b19b28c9af09e105637a2afa Mon Sep 17 00:00:00 2001 From: elmarzouguidev Date: Wed, 18 Oct 2023 11:20:40 +0100 Subject: [PATCH] add Class to check Smtp Connection v-2 --- app/Services/Smtp/CheckSmtpConnection.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/app/Services/Smtp/CheckSmtpConnection.php b/app/Services/Smtp/CheckSmtpConnection.php index 4632163..fb07e27 100644 --- a/app/Services/Smtp/CheckSmtpConnection.php +++ b/app/Services/Smtp/CheckSmtpConnection.php @@ -2,7 +2,6 @@ namespace App\Services\Smtp; -use Illuminate\Support\Facades\Http; use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; class CheckSmtpConnection @@ -10,10 +9,6 @@ class CheckSmtpConnection public static function isConnected(): bool { - /*if (!self::check(config('mail.mailers.smtp.host'))) { - return false; - }*/ - try { $transport = new EsmtpTransport(config('mail.mailers.smtp.host'), config('mail.mailers.smtp.port'), config('mail.mailers.smtp.encryption')); $transport->setUsername(config('mail.mailers.smtp.username')); @@ -26,16 +21,4 @@ public static function isConnected(): bool return false; } } - - private static function check($domainUrl): bool - { - try { - $response = Http::timeout(3)->get($domainUrl); - - return $response->successful(); - } catch (\Illuminate\Http\Client\ConnectionException $e) { - - return false; - } - } }