Skip to content
World Wide Web Server edited this page Jul 4, 2012 · 32 revisions

Code Igniter Richmail Library version 0.1

By Jan Willem Penterman [email protected] (Genoil on codeigniter.com) September 29, 2006

File:richmail-0.1.zip

Features:

This library extends the Email library, adding the following functions:

  • parse message body for images and add them as inline attachments
  • caches base64 encoded attachements for better performance

Installation:

The directories inside this archive should look familiar enough to you to know where to put the files...

Usage example:

[code] ; // Load Richmail library instead of 'email': $this->load->library('richmail');

// Since it subclasses CI_Email, this is all the same: $this->richmail->from('[email protected]', 'Sender'); $this->richmail->to('[email protected]', 'Recipient');
$this->richmail->subject('Richmail test');

// Load message like any CI view: $message = $this->load->view("richmail_view", array(), true);

// Convert message to have images reference inline content-id's. // $message is passed by reference, but is also returned if you // don't understand what I'm talking about.
$this->richmail->inline($message);

// This is like Email again: $this->richmail->message($message); $this->richmail->send(); [/code]

Notes:

  • Currently, only HTML image references are supported, no CSS. This is
    because inline CSS background images aren't supported very well in HTML email anyway.

  • The library assumes the host that serves the images is equal to the CI's base_url config var.

  • Base64 caching speeds up attachment building about 2 times, but I'm not too happy about having to duplicate the whole Email::_build_message() method.

Clone this wiki locally