molajo / email
Molajo Email: platform independent support with adapters for PHPMailer, SwiftMail, and native PHP mail
Installs: 441
Dependents: 2
Suggesters: 1
Security: 0
Stars: 0
Watchers: 5
Forks: 1
Open Issues: 0
Type:molajo-package
Requires
- php: >=5.4
- commonapi/email: dev-master
- phpmailer/phpmailer: dev-master
- swiftmailer/swiftmailer: dev-master
README
======= Email Package
Email Services API for PHP applications enabling interaction with multiple Email types (ex., PHP Mail, PHP Mailer, Swiftmailer, etc.).
At a glance ...
- 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();
Install using Composer from Packagist
Step 1: Install composer in your project
curl -s https://getcomposer.org/installer | php
Step 2: Create a composer.json file in your project root
{ "require": { "Molajo/Email": "1.*" } }
Step 3: Install via composer
php composer.phar install
Requirements and Compliance
- 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