salad-dressing / mailer
SaladStack Mailer extension
Package info
github.com/salad-dressings/salad-dressing-mailer
Type:salad-extension
pkg:composer/salad-dressing/mailer
1.1.0
2024-09-10 00:53 UTC
Requires
- phpmailer/phpmailer: ^6.9
README
SaladStack Extension to send mail using PHPMailer
To Install
composer require salad-dressing/mailer
To Update
composer update salad-dressing/mailer
Snapshots
Sending plain email
use Salad\Dressing\Mailer\Sender; public function index() { $this->sender = new Sender; $this->sender->addRecipient("test@saladstack.com"); $this->sender->setSubject("SaladStack Email Test"); $this->sender->setBody("This is a test email."); if($this->sender->send()){ echo "Email Sent!"; } else { echo "Sending failed."; } }
Sending html body email
use Salad\Dressing\Mailer\Sender; public function index() { $this->sender = new Sender; $this->sender->addRecipient("test@saladstack.com"); $this->sender->setSubject("SaladStack Email Test"); //adding true on the 2nd params will enable html body $this->sender->setBody("<h1>This is a test email.</h1>", true); if($this->sender->send()){ echo "Email Sent!"; } else { echo "Sending failed."; } }
