salad-dressing / mailer
SaladStack Mailer extension
Installs: 21
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:salad-extension
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."; } }