Email related classes

1.4.5 2024-07-17 06:30 UTC

This package is not auto-updated.

Last update: 2024-11-07 06:00:56 UTC


README

This is separated from https://codeberg.org/artfulrobot/artfulrobot as I still want to use it in 2024 but without needing to bring in a lot of old library code.

Email class

Generate MIME emails, with attachments and inline images supported. Example simple use:

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();

Uses PHP's mail() function, but you can inject your own signature-matched callback instead via $email->setMailService($callback)

A common use-case is to extend the Email class with a local one, e.g. to add signatures/headers.

Changelog

  • v1.4.4 imported from artfulrobot/artfulrobot v1.4.4 and updated for phpunit, php8.1, added type hints.