devinci-it/brevomailer
Composer 安装命令:
composer require devinci-it/brevomailer
包简介
Brevo SMTP Mailer Package
README 文档
README
A modern, modular, and strictly object-oriented SMTP library for PHP 8.1+. Designed to provide a clean, dry, and decoupled interface for sending emails via Brevo (or any SMTP provider) while maintaining environment agnosticism.
Features
- Strictly OOP: Decoupled architecture using Interfaces and Value Objects.
- Compose Method Pattern: Small, readable, single-responsibility methods.
- Environment Agnostic: No hardcoded
.envlogic within the core service. - Sender Overrides: Easily swap "From" identity on a per-email basis.
- Global Helper: Optional global
mailer()helper for easy access.
Installation
composer require devinci-it/brevo-mailer phpmailer/phpmailer vlucas/phpdotenv
Quick Start
use DevinciIT\BrevoMailer\MailerFactory; use DevinciIT\BrevoMailer\DTO\EmailMessage; // 1. Initialize $mailer = MailerFactory::createFromEnv(__DIR__); // 2. Send $mailer->send(new EmailMessage( to: 'client@example.com', subject: 'Hello World', htmlBody: '<h1>Test Email</h1>' ));
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-22