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

cviebrock/phpmailer-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHPMailer Bundle, by Colin Viebrock

Warning

This project is no longer maintained. If you want to make changes, please fork your own copy and use that in your Laravel 3 projects.


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 3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages