atelierspierrot / mime-mailer
A package to send rich MIME emails.
Installs: 108
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Language:HTML
Requires
- php: >=5.3.0
- atelierspierrot/library: 1.*
- atelierspierrot/patterns: 1.*
- atelierspierrot/validators: 1.*
Requires (Dev)
- phpmd/phpmd: 1.4.*
- sami/sami: dev-master
This package is not auto-updated.
Last update: 2024-03-02 11:29:26 UTC
README
A PHP package to send rich MIME emails.
Usage
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', //... ));
The 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:
( 'my@email.address' ) ( 'my@email.address', 'my name' ) ( array( 'my name'=>'my@email.address' ) ) ( array( 'my name'=>'my@email.address', 'another name'=>'another@email.address' ) ) ( array( 'my name'=>'my@email.address', 'another@email.address' ) )
Finally, to send built messages, just write:
$mailer->send()
Some logs are accessibles from the container with:
$mailer->getErrors() $mailer->getInfos()
Installation
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:
"atelierspierrot/mime-mailer": "@stable"
You can use a specific release or the latest release of a major version using the appropriate version constraint.
Please note that this package depends on the externals PHP Patterns, PHP Library and PHP Validators.
Author & License
MIME Mailer
Copyright (c) 2013-2016 Pierre Cassat and contributors
Licensed under the Apache Version 2.0 license.
Les Ateliers Pierrot - Paris, France
http://www.ateliers-pierrot.fr/ - contact@ateliers-pierrot.fr