与电子邮件相关的类

1.4.5 2024-07-17 06:30 UTC

This package is not auto-updated.

Last update: 2024-09-26 05:30:15 UTC


README

这个项目与https://codeberg.org/artfulrobot/artfulrobot分开,因为我仍然想在2024年使用它,但不需要引入大量的旧库代码。

电子邮件类

生成支持附件和内联图片的MIME电子邮件。示例简单用法

use ArtfulRobot\Email;

$email = new Email(
  $to = 'friend@example.com',
  $subject = 'demo',
  $body = '<p><strong>Hello</strong> world.</p>',
  $from = '"Fred Flintstone" <fred@example.org>"',
  $return_path = 'valid-on-your-server-or-verp@example.org'
  );
$result = $email->send();

使用PHP的mail()函数,但您可以通过$email->setMailService($callback)注入自己的签名匹配回调

一个常见的用例是用本地类扩展电子邮件类,例如添加签名/头信息。

变更日志

  • v1.4.4从artfulrobot/artfulrobot v1.4.4导入并更新为phpunit、php8.1,添加了类型提示。