Skip to content

An email module for Kohana 3.2, with support for HTML, attachments and multiple transports.

Notifications You must be signed in to change notification settings

Dachande663/Kohana-Email-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kohana Email v2

Kohana Email provides a standardized email interface for sending emails (including attachments) in the Kohana 3.2+ framework. It also provides a Spam Assassin score based on the excellent SpamChecker provided by Postmark (available to non-customers as well). This module does not use switfmailer out of personal distaste.

Features

  • Build emails using the common Kohana object format
  • Support for HTML and/or plain text emails
  • Support for attachments (thanks Josip)
  • Support for multiple transports
  • Does not require swiftmailer

Current Transports

Additional transports can be added by simply making a new file in /classes/email and extending Email_Transport.

Installation Instructions

  1. Copy Kohana Email to your modules directory (e.g. /modules/email)
  2. Add Kohana Email to your modules array in bootstrap.php
  3. Create a config file at /application/config/email.php and enter your details if necessary.
  4. You're ready to start sending emails!

Example Email

$email = Email::compose('my_config_group')
    ->to('[email protected]')
    ->cc('[email protected]')
    ->cc('[email protected]')
    ->from('[email protected]')
    ->reply('[email protected]')
    ->subject('Welcome to My Site')
    ->body('Plain text welcome message')
    ->body(View::factory('emails/welcome'), 'html')
    ->attachment('files/report.pdf');

try {
    $email->send();
} catch(Email_Exception) {
    echo $e->getMessage();
}

Methods

Notes

* This method can be called multiple times.

Email addresses can be in the form '[email protected]' or array('Proper Name', '[email protected]') and will be expanded to be "Proper Name [email protected]".

If a file attachment path does not begin with a slash, the Kohana DOCROOT is automatically prepended.

Thanks

About

An email module for Kohana 3.2, with support for HTML, attachments and multiple transports.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages