From 70efb210416783fc204ca47d0ee06b0574aacae8 Mon Sep 17 00:00:00 2001 From: Bozhidar Date: Thu, 19 Sep 2024 12:56:32 +0300 Subject: [PATCH] update --- web/Modules/Email/App/Filament/Pages/SendEmail.php | 13 ++++++++++++- web/composer.json | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/web/Modules/Email/App/Filament/Pages/SendEmail.php b/web/Modules/Email/App/Filament/Pages/SendEmail.php index e6ecf3c..ac4e12c 100644 --- a/web/Modules/Email/App/Filament/Pages/SendEmail.php +++ b/web/Modules/Email/App/Filament/Pages/SendEmail.php @@ -8,6 +8,7 @@ use Filament\Forms\Components\TextInput; use Filament\Forms\Form; use Filament\Notifications\Notification; use Filament\Pages\Page; +use PHPMailer\PHPMailer\PHPMailer; class SendEmail extends Page { @@ -55,7 +56,17 @@ Welcome to your new account. public function send() { - if (mail($this->to, $this->subject, $this->body)) { + + $phpMailer = new PHPMailer(); + $phpMailer->isMail(); + $phpMailer->setFrom('admin@allsidepixels.com', 'admin@allsidepixels.com'); + $phpMailer->addAddress($this->to); + $phpMailer->Subject = $this->subject; + $phpMailer->Body = $this->body; + + $sendMail = $phpMailer->send(); + + if ($sendMail) { // Trigger a success notification Notification::make() ->title('Email Sent') diff --git a/web/composer.json b/web/composer.json index 1b8834a..3c51c2c 100644 --- a/web/composer.json +++ b/web/composer.json @@ -26,6 +26,7 @@ "monarobase/country-list": "^3.5", "nwidart/laravel-modules": "^10.0", "outerweb/filament-settings": "^1.2", + "phpmailer/phpmailer": "^6.9", "phpseclib/phpseclib": "~3.0", "postare/blade-mdi": "^1.1", "riodwanto/filament-ace-editor": "^1.0",