There is no license information available for the latest version (v1.0.4) of this package.

v1.0.4 2022-01-21 07:10 UTC

This package is not auto-updated.

Last update: 2022-05-13 10:20:33 UTC


Scrutinizer Code Quality Code Coverage Build Status


$ composer require shippinno/email


Use a SendEmail to send an Email. It reattempts to send if $maxReattempts attribute is set.

use Shippinno\Email\SwiftMailer\SwiftMailerSendEmail;
use Tanigami\ValueObjects\Web\Email;
use Swift_Mailer;

$sendEmail = new SwiftMailerSendEmail(new Swift_Mailer(...));
    new Email(...),
    3 // max reattempts

Dealing with non RFC email address

Swift Mailer

Swift Mailer rejects Non RFC compliant email addresses by default.

You can set a custom email validator and Mime grammer (for Swift Mailer 5.x compatibility) allowing non RFC email address (e.g. by calling allow_non_rfc_email_address(); function.

use function Shippinno\Email\SwiftMailer\register_swift_non_rfc_email_validator;

(new Swift_Message)->setTo(''); // => OK

EmailAddress object

Tanigami\ValueObjects\Web\EmailAddress requires its value to be RFC compliant by default. You can have it soft validate by setting the second attribute of the constructor to true.

new EmailAddress('') // => InvalidArgumentException
new EmailAddress('', true); // => OK