function message_outgoing_body($args)
    {
        if ($args['type'] == 'html') {
            $this->load_config();

            $rcube = rcube::get_instance();
            if (!$rcube->config->get('emoticons_compose', true)) {
                return $args;
            }

            require_once __DIR__ . '/emoticons_engine.php';

            // look for "emoticon" images from TinyMCE and change their src paths to
            // be file paths on the server instead of URL paths.
            $images = emoticons_engine::replace($args['body']);

            // add these images as attachments to the MIME message
            foreach ($images as $img_name => $img_file) {
                $args['message']->addHTMLImage($img_file, 'image/gif', '', true, $img_name);
            }
        }

        return $args;
    }