Skip to content

awsmug/lib-mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Awesome Lib Mail

Easy and clean mail creation and transportation.

Version 1.0.0-beta-1

This little library allows you to create email objects easy sent by a selected transporter (PHP mail function, WordPress, etc.).

Example

<?php

use AWSM\LibMail\Transporter\PhpMail;
use AWSM\LibMail\Mail;
use AWSM\LibMail\MailException;


$mail = new Mail();
$transporter = new PhpMail();

try {
    $mail->addToEmail( '[email protected]' );
    $mail->setFromName( 'Developer' );
    $mail->setFromEmail( '[email protected]' );
    $mail->setSubject( 'Read my mail!' );
    $mail->setContent( 'Hello John! Greetings from the developer!' );

    $transporter->setMail( $mail );
    $transporter->send();
} catch ( MailException $e ) {
    echo $e->getMessage();
}