email-parsing

How do I get just the text content from a multipart email?

落花浮王杯 提交于 2019-11-27 18:49:38
问题 #!/usr/bin/php -q <?php $savefile = "savehere.txt"; $sf = fopen($savefile, 'a') or die("can't open file"); ob_start(); // read from stdin $fd = fopen("php://stdin", "r"); $email = ""; while (!feof($fd)) { $email .= fread($fd, 1024); } fclose($fd); // handle email $lines = explode("\n", $email); // empty vars $from = ""; $subject = ""; $headers = ""; $message = ""; $splittingheaders = true; for ($i=0; $i < count($lines); $i++) { if ($splittingheaders) { // this is a header $headers .= $lines[

Parse email content from quoted reply

若如初见. 提交于 2019-11-27 05:49:18
I'm trying to figure out how to parse out the text of an email from any quoted reply text that it might include. I've noticed that usually email clients will put an "On such and such date so and so wrote" or prefix the lines with an angle bracket. Unfortunately, not everyone does this. Does anyone have any idea on how to programmatically detect reply text? I am using C# to write this parser. VanOrman I did a lot more searching on this and here's what I've found. There are basically two situations under which you are doing this: when you have the entire thread and when you don't. I'll break it

Java Email message Parser?

大憨熊 提交于 2019-11-27 03:44:52
Is anyone familiar with a Java library that helps with parsing the fields (date, subject, from, to) of the email below? Message-ID: <19815303.1075861029555.JavaMail.ss@kk> Date: Wed, 6 Mar 2010 12:32:20 -0800 (PST) From: someone@someotherplace.com To: someone@someplace.com Subject: some subject Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-From: one, some <some.one@someotherplace.com> X-To: one X-cc: X-bcc: X-Folder: Bob\Inbox X-Origin: Bob-R X-FileName: rbob (Non-Privileged).pst some message Jherico JavaMail is an oracle library that provides

Parse email content from quoted reply

人盡茶涼 提交于 2019-11-26 10:05:41
问题 I\'m trying to figure out how to parse out the text of an email from any quoted reply text that it might include. I\'ve noticed that usually email clients will put an \"On such and such date so and so wrote\" or prefix the lines with an angle bracket. Unfortunately, not everyone does this. Does anyone have any idea on how to programmatically detect reply text? I am using C# to write this parser. 回答1: I did a lot more searching on this and here's what I've found. There are basically two