]> git.donarmstrong.com Git - roundcube.git/blob - program/steps/utils/html2text.inc
d61eb7c51fb24cccd8aad7bc382f94d61d46bc7a
[roundcube.git] / program / steps / utils / html2text.inc
1 <?php
2 /*
3
4  +-----------------------------------------------------------------------+
5  | program/steps/utils/html2text.inc                                     |
6  |                                                                       |
7  | This file is part of the Roundcube Webmail client                     |
8  | Copyright (C) 2005-2010, Roundcube Dev. - Switzerland                 |
9  | Licensed under the GNU GPL                                            |
10  |                                                                       |
11  | PURPOSE:                                                              |
12  |   Convert HTML message to plain text                                  |
13  |                                                                       |
14  +-----------------------------------------------------------------------+
15  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16  +-----------------------------------------------------------------------+
17
18  $Id: html2text.inc 4309 2010-12-06 11:13:55Z alec $
19
20 */
21
22 $html = $HTTP_RAW_POST_DATA;
23
24 // Replace emoticon images with its text representation
25 $html = rcmail_replace_emoticons($html);
26
27 $converter = new html2text($html);
28
29 header('Content-Type: text/plain; charset=UTF-8');
30 print rtrim($converter->get_text());
31 exit;
32
33