2017 © Pedro Peláez
 

library email_library

Email Library based on PHPMailer

image

xcytek/email_library

Email Library based on PHPMailer

  • Friday, October 7, 2016
  • by xcytek
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 50 % Grown

The README.md

email_library

Easy Email Library based on PHPMailer, (*1)

Example How To Use:, (*2)

// Autoload files using Composer autoload
require_once __DIR__ . '/../vendor/autoload.php';

// Email Structure Instance with Template Path and Optional Data
$email = new \Xcytek\EmailLibrary\Email('templates/basic.php', [
    'author'  => 'Alex Acosta',
    'email'   => 'alexcytek@gmail.com',
    'twitter' => '@xcytek',
]);

// Set SMTP account params
$email->config['username'] = 'your@email.com';
$email->config['password'] = 'your_password';
$email->config['who_sent'] = 'Who is sending';

// Use data necessary (MANDATORY) to send the email
$email->setUse([
    'subject' => 'Xcytek Easy Email Library',

    // Can add more than one
    'to' => [
        [
            'email' => 'alexcytek@gmail.com',
            'name'  => 'Alex Acosta',
        ]
    ]
]);

// Email Sender Instance
$emailSender = new \Xcytek\EmailLibrary\EmailSender();

// Try sending the email
if ($emailSender->send($email)) {
    echo 'Mail sent to ' . $email->getData()['email'];
} else {
    echo 'Mail cannot be delivered to ' . $email->getData()['email'];
}

The Versions

07/10 2016

dev-master

9999999-dev

Email Library based on PHPMailer

  Sources   Download

MIT

The Requires

 

by Alex Acosta