Email Services API for PHP applications enabling interaction with multiple Email types (ex., PHP Mail, PHP Mailer, Swiftmailer, etc.).
- Instantiate a Mail Handler.
- Instantiate the Adapter, injecting it with the Handler.
- Set mail parameters.
- Send mail.
// 1. Instantiate an Email Handler.
$options = array();
$options['mailer_transport'] = 'mail';
$options['site_name'] = 'Sitename';
$options['Fieldhandler'] = new Fieldhandler();
$class = 'Molajo\\Email\\Handler\\PhpMailer';
$handler = new $class($options);
// 2. Instantiate the Adapter, injecting it with the Handler.
$class = 'Molajo\\Email\\Adapter';
$this->adapter = new $class($handler);
// 3. Set email parameters
$this->adapter->set('to', 'AmyStephen@Molajo.org,Fname Lname');
$this->adapter->set('from', 'AmyStephen@Molajo.org,Fname Lname');
$this->adapter->set('reply_to', 'AmyStephen@Molajo.org,FName LName');
$this->adapter->set('cc', 'AmyStephen@Molajo.org,FName LName');
$this->adapter->set('bcc', 'AmyStephen@Molajo.org,FName LName');
$this->adapter->set('subject', 'Welcome to our Site');
$this->adapter->set('body', 'Stuff goes here');
$this->adapter->set('mailer_html_or_text', 'text');
// 4. Send Email.
$this->adapter->send();
curl -s https://getcomposer.org/installer | php
{
"require": {
"Molajo/Email": "1.*"
}
}
php composer.phar install
- PHP framework independent, no dependencies
- Requires PHP 5.4, or above
- Semantic Versioning
- Compliant with:
- [phpDocumentor2] (https://github.com/phpDocumentor/phpDocumentor2)
- [phpUnit Testing] (https://github.com/sebastianbergmann/phpunit)
- Author AmyStephen
- [Travis Continuous Improvement] (https://travis-ci.org/profile/Molajo)
- Listed on [Packagist] (http://packagist.org) and installed using [Composer] (http://getcomposer.org/)
- Use github to submit pull requests and features
- Licensed under the MIT License - see the
LICENSE
file for details