fawno / fawnoemail
FawnoEmail for CakePHP 3
4.0.1
2022-09-14 10:57 UTC
Requires
- cakephp/cakephp: >=4.4.0
This package is auto-updated.
Last update: 2024-09-14 15:29:11 UTC
README
FawnoEmail
扩展 Cake\Mailer\Email,允许模板中内联图片。
通过composer安装
自v3以来,CakePHP使用composer,最简单的设置方法是运行
composer require fawno/fawnoemail
用法
每次需要发送电子邮件时,请确保此类已被加载
use Fawno\Mailer\FawnoEmail;
像正常使用 CakeEmail 一样使用此类
$email = new FawnoEmail(); $email->to(array('example@example.com' => 'Example')); $email->subject('Example Email'); $email->template('default'); $email->send();
在模板中
<img src="cid:/full/path/image"> <img src="cid:///full/path/image"> <img src="file:/full/path/image"> <img src="file:///full/path/image"> echo $this->Html->image('cid:///full/path/image'); echo $this->Html->image('file:///full/path/image');