2017 © Pedro Peláez
 

library mime-mailer

A package to send rich MIME emails.

image

atelierspierrot/mime-mailer

A package to send rich MIME emails.

  • Saturday, January 2, 2016
  • by picas
  • Repository
  • 1 Watchers
  • 1 Stars
  • 97 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

MIME Mailer

demonstation documentation A PHP package to send rich MIME emails., (*1)

Usage

To create a Mailer instance, just write:, (*2)

$mailer = \MimeMailer\Mailer::getInstance();

You can define a set of user options writing:, (*3)

$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:, (*4)

$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:, (*5)

$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., (*6)

All "persons" fields can be defined as the followings:, (*7)

 ( '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:, (*8)

$mailer->send()

Some logs are accessibles from the container with:, (*9)

$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., (*10)

If you are a Composer user, just add the package to the requirements of your project's composer.json manifest file:, (*11)

"atelierspierrot/mime-mailer": "@stable"

You can use a specific release or the latest release of a major version using the appropriate version constraint., (*12)

Please note that this package depends on the externals PHP Patterns, PHP Library and PHP Validators., (*13)

Author & License

MIME Mailer, (*14)

http://github.com/atelierspierrot/mime-mailer, (*15)

Copyright (c) 2013-2016 Pierre Cassat and contributors, (*16)

Licensed under the Apache Version 2.0 license., (*17)

http://www.apache.org/licenses/LICENSE-2.0, (*18)


Les Ateliers Pierrot - Paris, France, (*19)

http://www.ateliers-pierrot.fr/ - contact@ateliers-pierrot.fr, (*20)

The Versions