[REBOL] Re: Extracting Info from Emails
From: hallvard:ystad:oops-as:no at: 15-Jun-2005 18:16
Hi again
I suddenly realized that noone has given an example.
Here's one (Warning! This is long!). I copied it from the
rebol console, so that's where the extra "{" on each line
is from. Here goes (it's your original email):
>> probe a: import-email {Received: by 10.38.24.21 with SMTP id 21mr1926733rnx;
{ Wed, 15 Jun 2005 01:30:48 -0700 (PDT)
{ Received: with ECARTIS (v1.0.0; list rebol); Wed, 15
Jun 2005 04:30:30 -0400 (EDT)
{ From: "Michael C. McCann" <[removed--mccannworld--com]>
{ To: <[removed--rebol--com]>
{ Subject: [REBOL] Extracting Info from Emails
{ Date: Wed, 15 Jun 2005 01:30:15 -0700
{ MIME-Version: 1.0
{ Content-type: text/plain
{ Sender: [removed--rebol--com]
{ Errors-To: [removed--rebol--com]
{ Precedence: bulk
{ Reply-To: [removed--rebol--com]
{ X-list: rebol
{
{ Hello Everyone,
{
{ I am new to Rebol and would like to extact certain
bits of information from
{ consistently formatted emails as they arrive in my
Outlook inbox. Is this
{ possible, and how might I go about doing this?
{
{ Thanks very much,
{ Michael McCann
{
{ }
make object! [
To: [[removed--rebol--com]]
CC: none
BCC: none
From: [[removed--mccannworld--com]]
Reply-To: [[removed--rebol--com]]
Date: 15-Jun-2005/1:30:15-7:00
Subject: "[REBOL] Extracting Info from Emails"
Return-Path: none
Organization: none
Message-Id: none
Comment: none
X-REBOL: "Core 2.5.6.3.1 http://WWW.REBOL.COM"
MIME-Version: "1.0"
Content-Type: "text/plain"
Content: {Hello Everyone,
I am new to Rebol and would like to extact certain bits
of information from
consistently formatted emails as they arrive in my Outlook
inbox. Is this
possible, and how might I go about doing this?
Thanks very much,
Michael McCann
}
Received: {with ECARTIS (v1.0.0; list rebol); Wed, 15
Jun 2005 04:30:30 -0400 (EDT)}
Sender: "[removed--rebol--com]"
Errors-To: "[removed--rebol--com]"
Precedence: "bulk"
X-list: "rebol"
]
>>
You now can access any field in the email like this:
>> a/Date
== 15-Jun-2005/1:30:15-7:00
>> a/X-list
== "rebol"
etc.
HY
Dixit "Michael C. McCann" <[michael--mccannworld--com]> (Wed,
15 Jun 2005 01:30:15 -0700):