Overview
We really liked the email library offered by Codeigniter but of course this library is not composer / packagist ready. So we made our own version. Here are the things we changed., (*1)
-
We added a wrapper class so we can call this via a static function call (see below)., (*2)
-
We hardcoded the charset to 'utf-8' in a few places., (*3)
-
We stripped out all the local lang. support., (*4)
-
We stripped out all the CI logging stuff., (*5)
-
We set html as the default email type., (*6)
-
We set the default useragent to "Cloudmaic", (*7)
-
We set the defaul newline to "\r\n", (*8)
How To Use
All the function calls are documented here: http://ellislab.com/codeigniter/user-guide/libraries/email.html, (*9)
Cloudmanic\Email\Message::initialize(array(
'smtp_host' => '',
'smtp_port' => '',
'smtp_user' => '',
'smtp_pass' => ''
));
Cloudmanic\Email\Message::from('support@cloudmanic.com', 'Cloudmanic Support');
Cloudmanic\Email\Message::to('user@example.com');
Cloudmanic\Email\Message::subject('Email Test');
Cloudmanic\Email\Message::message('My Message');
Cloudmanic\Email\Message::send();
echo Cloudmanic\Email\Message::print_debugger();