Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

tectonic/phpmailer-laravel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHPMailer Bundle, by Colin Viebrock

A Laravel PHPMailer bundle, installable via the Artisan CLI:

php artisan bundle:install phpmailer

Add it to application/bundles.php:

return array(
    ...
    'phpmailer' => array(
        'auto'  => true
    ),
    ...
);

To get a PHPMailer instance:

$mailer = IoC::resolve('phpmailer');

Then, use it just like you normally might:

try {
    $mailer->AddAddress( $user->email, $user->name );
    $mailer->Subject  = "Laravel Rocks";
    $mailer->Body     = "Hi! Laravel is awesomesauce!";
    $mailer->Send();
} catch (Exception $e) {
    echo 'Message was not sent.';
    echo 'Mailer error: ' . $e->getMessage();
}

The default "From:" address -- among other settings -- can be defined in the configuration file.


Includes PHPMailer - Full Featured Email Transfer Class for PHP

About

PHPMailer bundle for Laravel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published