2017 © Pedro Peláez
 

library raw-mail

RawMail is a wrapper around PHPMailer and is used by RawPHP framework and other applications.

image

rawphp/raw-mail

RawMail is a wrapper around PHPMailer and is used by RawPHP framework and other applications.

  • Tuesday, December 16, 2014
  • by rawphp
  • Repository
  • 2 Watchers
  • 1 Stars
  • 339 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

RawMail - A Simple Wrapper around PHPMailer

Build Status Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

SensioLabsInsight, (*2)

Package Features

  • Simple to use mailer
  • SMTP support
  • Supports attachments

Installation

Composer

RawMail is available via Composer/Packagist., (*3)

Add "rawphp/raw-mail": "0.*@dev" to the require block in your composer.json and then run composer install., (*4)

{
        "require": {
            "rawphp/raw-mail": "0.*@dev"
        }
}

You can also simply run the following from the command line:, (*5)

composer require rawphp/raw-mail "0.*@dev"

Tarball

Alternatively, just copy the contents of the RawMail folder into somewhere that's in your PHP include_path setting. If you don't speak git or just want a tarball, click the 'zip' button at the top of the page in GitHub., (*6)

Basic Usage

<?php

use RawPHP\RawMail\Mail;

// configuration
$config = array(
    'from_email'   => 'no-reply@rawphp.org',                // default from email to use in emails
    'from_name'    => 'RawPHP',                             // default from name to use in emails

    'smtp' => array( 'auth'     => TRUE ),                  // enable SMTP authentication
    'smtp' => array( 'host'     => 'smtp.gmail.com' ),      // main and backup SMTP servers
    'smtp' => array( 'username' => 'username' ),            // SMTP username
    'smtp' => array( 'password' => 'password' ),            // SMTP password
    'smtp' => array( 'security' => 'ssl' ),                 // Enable TLS encryption, 'ssl' also accepted
    'smtp' => array( 'port'     => '465' ),                 // SMTP port
);

// instantiate new mail instance
$mail = new Mail( );

// initialise mailer
$mail->init( $config );

// add recipient
$mail->addTo( array( 'email@example.com', 'John Smith' ) );

// set subject
$mail->setSubject( 'Demo Message' );

// set body
$mail->setBody( '

Hello from Demo

' ); // add attachment $mail->addAttachment( '/path/to/file' ); $mail->send( );

License

This package is licensed under the MIT. Read LICENSE for information on the software availability and distribution., (*7)

Contributing

Please submit bug reports, suggestions and pull requests to the GitHub issue tracker., (*8)

Changelog

22-09-2014

  • Updated to PHP 5.3.

20-09-2014

  • Replaced php array configuration with yaml

18-09-2014

  • Updated to work with the latest rawphp/rawbase package.

13-09-2014

  • Initial Code Commit.

The Versions

16/12 2014

dev-master

9999999-dev http://rawphp.org

RawMail is a wrapper around PHPMailer and is used by RawPHP framework and other applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tom Kaczocha

email smtp