2017 © Pedro Peláez
 

library email

PHP Email Library For AWSSES, MAILGUN, SMTP, SPARKPOST

image

phpbook/email

PHP Email Library For AWSSES, MAILGUN, SMTP, SPARKPOST

  • Thursday, June 14, 2018
  • by phpbook
  • Repository
  • 0 Watchers
  • 1 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

About Email

  • A lightweight e-mail PHP library available for SMTP, AWSSES, MAILGUN AND SPARKPOST
  • Requires PHP Extension FINFO.

Composer Install

composer require phpbook/email

Declare Configurations


/******************************************** * * Declare Configurations * * ******************************************/ //Driver connection SMTP \PHPBook\Email\Configuration\Email::setConnection('main', (new \PHPBook\Email\Configuration\Connection) ->setName('Main') ->setExceptionCatcher(function(String $message) { //the PHPBook Email does not throw exceptions, but you can take it here //you can store $message in database or something else }) ->setDriver((new \PHPBook\Email\Driver\SMTP) ->setHost('host') ->setPort(100) ->setUser('user') ->setPassword('password') ->setSecure('tls') ->setEmail('email@email.com') ->setName('Jhon') ->setEncode('utf8')) ); //Driver connection AWSSES \PHPBook\Email\Configuration\Email::setConnection('other', (new \PHPBook\Email\Configuration\Connection) ->setName('Other') ->setExceptionCatcher(function(String $message) { //the PHPBook Email does not throw exceptions, but you can take it here //you can store $message in database or something else }) ->setDriver((new \PHPBook\Email\Driver\AWSSES) ->setKey('key') ->setSecret('secret') ->setRegion('region') ->setEmail('email@email.com') ->setName('Jhon')) ); //Driver connection MAILGUN \PHPBook\Email\Configuration\Email::setConnection('important', (new \PHPBook\Email\Configuration\Connection) ->setName('Important') ->setExceptionCatcher(function(String $message) { //the PHPBook Email does not throw exceptions, but you can take it here //you can store $message in database or something else }) ->setDriver((new \PHPBook\Email\Driver\MAILGUN) ->setKey('key') ->setDomain('domain') ->setEmail('email@email.com') ->setName('Jhon')) ); //Driver connection SPARKPOST \PHPBook\Email\Configuration\Email::setConnection('backups', (new \PHPBook\Email\Configuration\Connection) ->setName('Backups') ->setExceptionCatcher(function(String $message) { //the PHPBook Email does not throw exceptions, but you can take it here //you can store $message in database or something else }) ->setDriver((new \PHPBook\Email\Driver\SPARKPOST) ->setKey('key') ->setEmail('email@email.com') ->setName('Jhon')) ); //Set default connection by connection alias \PHPBook\Email\Configuration\Email::setDefault('main'); //Getting connections $connections = \PHPBook\Email\Configuration\Email::getConnections(); foreach($connections as $code => $connection) { $connection->getName(); $connection->getDriver(); }; ?>

Sending Emails



//Connection code is not required if you set default connection $boolean = (new \PHPBook\Email\Email) ->setConnectionCode('other') ->setMessage( (new \PHPBook\Email\Message) ->setFromName('example@email.com') //custom from name. not required. ->setFromEmail('example@email.com') //custom from email. not required. ->setTo(['jhon@email.com']) ->setCc(['paul@email.com']) ->setCco(['ana@email.com']) ->setSubject('email subject') ->setContent('my html body') ->setAttach([ (new \PHPBook\Email\Attach)->setFileAlias('myfile')->setFileBuffer('my-file-buffer'), (new \PHPBook\Email\Attach)->setFileAlias('myfile')->setFilePath('my/file/path') ]) )->dispatch(); if ($boolean) { //sent };

The Versions

14/06 2018

dev-master

9999999-dev https://github.com/phpbook-sources/email

PHP Email Library For AWSSES, MAILGUN, SMTP, SPARKPOST

  Sources   Download

MIT

The Requires

  • php >=7.1.0

 

by Avatar phpbook

email php lightweight fast

14/06 2018

1.0.3

1.0.3.0 https://github.com/phpbook-sources/email

PHP Email Library For AWSSES, MAILGUN, SMTP, SPARKPOST

  Sources   Download

MIT

The Requires

  • php >=7.1.0

 

by Avatar phpbook

email php lightweight fast

14/06 2018

1.0.1

1.0.1.0 https://github.com/phpbook-sources/email

PHP Email Library For AWSSES, MAILGUN, SMTP, SPARKPOST

  Sources   Download

MIT

The Requires

 

by Avatar phpbook

email php lightweight fast

14/06 2018

1.0.2

1.0.2.0 https://github.com/phpbook-sources/email

PHP Email Library For AWSSES, MAILGUN, SMTP, SPARKPOST

  Sources   Download

MIT

The Requires

 

by Avatar phpbook

email php lightweight fast

14/06 2018

1.0.0

1.0.0.0 https://github.com/phpbook-sources/email

PHP Email Library For AWSSES, MAILGUN, SMTP, SPARKPOST

  Sources   Download

MIT

The Requires

 

by Avatar phpbook

email php lightweight fast