Coder Social home page Coder Social logo

rawmail's Introduction

RawMail - A Simple Wrapper around PHPMailer

Build Status Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License

SensioLabsInsight

Package Features

  • Simple to use mailer
  • SMTP support
  • Supports attachments

Installation

Composer

RawMail is available via Composer/Packagist.

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

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

You can also simply run the following from the command line:

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.

Basic Usage

<?php

use RawPHP\RawMail\Mail;

// configuration
$config = array(
    'from_email'   => '[email protected]',                // 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 protected]', 'John Smith' ) );

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

// set body
$mail->setBody( '<h2>Hello from Demo</h2>' );

// 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.

Contributing

Please submit bug reports, suggestions and pull requests to the GitHub issue tracker.

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.

rawmail's People

Stargazers

Alexander G. avatar

Watchers

James Cloos avatar Tom Kaczocha avatar Alexander G. avatar

rawmail's Issues

Error installing dependence @version

Composer showing me the following::

Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package rawphp/raw-mail could not be found in any version, there may be a typo in the package name.

Potential causes:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.