A package to send rich MIME emails.
To create a Mailer instance, just write:
$mailer = \MimeMailer\Mailer::getInstance();
You can define a set of user options writing:
$mailer = \MimeMailer\Mailer::getInstance(array( 'options name' => 'option value', //... ));
Mailer instance acts like a global container to build messages and send them. It handles
a set of messages as an array. From this container, you can access to:
$mailer->getMessage() // the current message object $mailer->getTransporter() // the current transporter object $mailer->getSpooler() // the current spooler object
To work on current message, you can write:
$mailer->getMessage() // the message will be created if none was defined ->setTo(...) ->setSubject(...) ->setText(...) //... ;
Many methods are defined to build a message, please refer to the PHP class itself to learn more.
All "persons" fields can be defined as the followings:
( 'firstname.lastname@example.org' ) ( 'email@example.com', 'my name' ) ( array( 'my name'=>'firstname.lastname@example.org' ) ) ( array( 'my name'=>'email@example.com', 'another name'=>'firstname.lastname@example.org' ) ) ( array( 'my name'=>'email@example.com', 'firstname.lastname@example.org' ) )
Finally, to send built messages, just write:
Some logs are accessibles from the container with:
For a complete information about how to install this package and load its namespace, please have a look at our USAGE documentation.
If you are a Composer user, just add the package to the
requirements of your project's
composer.json manifest file:
You can use a specific release or the latest release of a major version using the appropriate version constraint.
Copyright (c) 2013-2016 Pierre Cassat and contributors
Licensed under the Apache Version 2.0 license.
Les Ateliers Pierrot - Paris, France