0

我已经在java中编写了一个函数来获得这个。在收到电子邮件时,我将邮件内容存储到外部文件中

MIME-Version: 1.0 Received: by 10.216.237.25 with SMTP id       x25mr3166819weq.30.1346350346502; Thu, 30 Aug 2012 11:12:26 -0700 (PDT)Received: by 10.216.123.197 with HTTP; Thu, 30 Aug 2012 11:12:26 -0700 (PDT)Date: Thu, 30 Aug 2012 20:12:26 +0200 Message-ID: <CAEE+wmOpUFC9Nb9wNAVKsCrFRX7GmDwhDya4brB=hvRHXY6q7Q@mail.gmail.com> Subject: ok, lets see ... From: ABCD DEFG <xyz@gmail.com> To: XYX <xyz@yahoo.com>, def@gmail.com Content-Type: multipart/alternative; boundary=000e0cd5f7142581b204c87f9ed5 X-Processed-By: mx3.mail.genotec.ch X-Spam-Checksum: a84a5db7738f685c28343edc93a6546a X-Greylist: Sender IP 209.85.212.179 not delayed X-Spam-Report: ---- Start der SpamAssassin Auswertung  -1.0 ALL_TRUSTED  Passed through trusted hosts only via SMTP    -0.1 SPF_PASS               SPF: sender matches SPF record   0.0 HTML_MESSAGE           BODY: HTML included in message
    -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from author's
                                domain
    -0.1 DKIM_VALID             Message has at least one valid DKIM or DK signature
     0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily valid
    ---- Ende der SpamAssassin Auswertung X-GIC-MailScanner-SpamScore: -1.199
X-GIC-MailScanner-SpamCheck: ham, hits=-1.199 required=10 scantime="4.74 seconds" origip=209.85.212.179  X-Scanned-By: "MGate 1.0" on 82.195.224.57 
--000e0cd5f7142581b204c87f9ed5  Content-Type: text/plain; charset=ISO-8859-1
hello worldli ...  --000e0cd5f7142581b204c87f9ed5 Content-Type: text/html; charset=ISO-8859-1  hello worldli ... --000e0cd5f7142581b204c87f9ed5--

我们可以看到它没有对齐..我想根据发件人、收件人、电子邮件的实际内容、日期对数据进行排序(简而言之,我只想要发件人、收件人、日期、实际数据)...... . 我怎样才能使用 JAVASCRIPT 实现这一点。应该避免其他不必要的事情......并且必须在文本框中显示获取的数据......假设四个字段的四个文本框......

4

1 回答 1

0

您可以使用正则表达式来完成此任务。

您可以为每个字段编写 4 个不同的正则表达式。

于 2012-12-27T13:24:49.073 回答