This commit is contained in:
Bozhidar 2024-09-19 12:56:32 +03:00
parent 242649aa9e
commit 70efb21041
2 changed files with 13 additions and 1 deletions

View file

@ -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')

View file

@ -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",