2017 © Pedro Peláez
 

library mailer

Mail Abstraction Class

image

rcastera/mailer

Mail Abstraction Class

  • Saturday, September 28, 2013
  • by rcastera
  • Repository
  • 1 Watchers
  • 9 Stars
  • 50 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHP Mail Class with Attachments

A simple wrapper to PHP's native mail function that includes cc, bcc, priority and attachments., (*1)

### Setup

Add a composer.json file to your project:, (*2)

{
  "require": {
      "rcastera/mailer": "v1.0.0"
  }
}

Then provided you have composer installed, you can run the following command:, (*3)

$ composer.phar install

That will fetch the library and its dependencies inside your vendor folder. Then you can add the following to your .php files in order to use the library (if you don't already have one)., (*4)

require 'vendor/autoload.php';

Then you need to use the relevant class, and instantiate the class. For example:, (*5)

### Getting Started

require 'vendor/autoload.php';

use rcastera\Email\Mailer;

$mailer = new Mailer();

### Example

priority(3); // 1 for urgent, 3 for normal.
    $mailer->to(array('email@domain.com'));
    $mailer->cc(array('email@domain.com'));
    $mailer->bcc(array('email@domain.com'));
    $mailer->from('John Doe', 'email@domain.com');
    $mailer->subject('This is a test!');
    $mailer->body('Hi this is the body of the email.');
    $mailer->attach(array('example.zip'));

    if ($mailer->send()) {
        echo('Email sent!');
    } else {
        echo('Error sending Email!');
    }

    unset($mailer);
?>

Contributing

  1. Fork it.
  2. Create a branch (git checkout -b my_branch)
  3. Commit your changes (git commit -am "Added something")
  4. Push to the branch (git push origin my_branch)
  5. Create an [Issue][1] with a link to your branch
  6. Enjoy a refreshing Coke and wait

The Versions

28/09 2013

dev-master

9999999-dev http://www.richardcastera.com

Mail Abstraction Class

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Richard Castera

mail php

28/09 2013

v1.0.0

1.0.0.0 http://www.richardcastera.com

Mail Abstraction Class

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Richard Castera

mail php