A modification of: http://www.yiiframework.com/extension/phpmailer/ to take views and templating into account