Skip to content

switon-php/mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Switon Mail Package

Mail message composition and SMTP delivery for Switon Framework.

Installation

composer require switon/mail

Requirements: PHP 8.3+, ext-curl

Quick Start

use Switon\Core\Attribute\Autowired;
use Switon\Mail\Address;
use Switon\Mail\MailerInterface;
use Switon\Mail\Message;

class NotifyService
{
    #[Autowired] protected MailerInterface $mailer;

    public function ping(string $to): void
    {
        $msg = Message::compose()
            ->from(new Address('app@example.com'))
            ->to(new Address($to))
            ->subject('Ping')
            ->text('Hello.');

        $this->mailer->send($msg->get());
    }
}

Docs: https://docs.switon.dev/latest/mail

License

MIT.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages