emercury-dev/smtp-php-mailer

Emercury 邮件桥接器

安装次数: 5

依赖项: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:symfony-mailer-bridge

0.1.1 2024-06-26 09:44 UTC

This package is auto-updated.

Last update: 2024-09-26 10:16:01 UTC


README

提供 Emercury 对 Symfony Mailer 的集成。

配置示例

# API
MAILER_DSN=emercury+api://KEY@default

其中

  • KEY 是您的 Emercury 令牌

入门指南

composer require emercury-dev/smtp-php-mailer
use Emercury\Smtp\SmtpApiTransport;
use Symfony\Component\Mailer\Mailer;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Address;

$mailer = new Mailer(new SmtpApiTransport('xxxTokenxxx'));

$email = (new Email())
    ->from(new Address('hello@example.com', 'Hello'))
    ->to(new Address('you@example.com', 'You'))
    ->replyTo(new Address('hello@example.com', 'Hello'))
    ->subject('Hello!')
    ->text('Sending emails is fun!')
    ->html('<p>Sending emails is fun with HTML integration!</p>');

$mailer->send($email);