A simple SMTP class with a fresh start.
Switch branches/tags
Nothing to show
Pull request Compare This branch is 1 commit ahead, 39 commits behind swt83:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


SMTP for LaravelPHP

This package is a new SMTP class built from scratch. Many of the existing email libraries are old, bloated, not on GitHub, and worst of all written in camelcase. I wanted something short and simple.


In application/bundles.php add:

'smtp' => array('auto' => true),

Copy the sample config file to application/config/smtp.php and input the proper information.


A normal email would go like this:

$mail = new SMTP();
$mail->from('paul@gmail.com', 'Paul T.');
$mail->subject('Hello World');
$mail->body('This is a <b>HTML</b> email.');
$result = $mail->send();

You can add multiple recipients, name is optional:

// add to

// add cc

// add bcc

You can set a custom reply-to address:

$mail->reply('paul@gmail.com', 'Paul T.');

You can add attachments:


You can assign a text version of your email:

$mail->text('This is a text email.');

You can send text-only emails:

$result = $mail->send_text();

Debug Mode

In the config you can flag 'debug_mode' = true;, which can be helpful in testing your SMTP connections. It will echo server responses from each step in the email sending process.


Below are some current limitations. Please feel free to contribute to this ongoing project.

  • Does not support encryption.
  • Does not support priority level.
  • Does not keep connection open for spooling email sends.