SaladStack Mailer extension

1.1.0 2024-09-10 00:53 UTC

This package is auto-updated.

Last update: 2025-08-10 04:04:32 UTC


README

SaladStack Extension to send mail using PHPMailer

To Install

composer require salad-dressing/mailer

To Update

composer update salad-dressing/mailer

Snapshots

salad-dressing/mailer

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.";
    }
}