flowmailer/symfony-flowmailer-mailer
最新稳定版本:1.0.2
Composer 安装命令:
composer require flowmailer/symfony-flowmailer-mailer
包简介
Provides Flowmailer integration for Symfony Mailer
README 文档
README
Provides Flowmailer integration for Symfony Mailer.
Installation
composer require flowmailer/symfony-flowmailer-mailer
Configuration
Obtain credentials from Flowmailer credentials wizard
Add the obtained credentials to the MAILER_DSN in the env file:
MAILER_DSN=flowmailer://CLIENT_ID:CLIENT_SECRET@api.flowmailer.net?account_id=1234
When using in a symfony project, you'll need to tag the transport factory as a 'mailer.transport_factory'.
# config/services.yaml services: # Other services Flowmailer\Symfony\Mailer\Transport\FlowmailerTransportFactory: parent: 'mailer.transport_factory.abstract' tags: - name: 'mailer.transport_factory'
Stand alone:
use Symfony\Component\Mailer\Mailer; use Symfony\Component\Mailer\Transport; use Flowmailer\Symfony\Mailer\Transport\FlowmailerTransportFactory; $factory = new FlowmailerTransportFactory(); $transport = new Transport([$factory]); $mailer = new Mailer($transport->fromString($dsnString)); $email = (new Email()) ->from('example@example.com') ->to('example@example.com') ->subject('Test e-mail') ->text('This is the content of the email') ->html('<p>Test e-mail with inline image</p><img src="cid:inline-image">') ->attachFromPath('path/to/attachment.pdf') ->embedFromPath('path/to/inline-image.png', 'inline-image') ; $mailer->send($email);
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-16