Here is the format which the file I need to parse is in:
From constant-address@will.never.change.com Mon Jun 17 10:31:01 2002
Random E-Mail crap that is not required and changes upon how the email is sent..
From: Dynamic Personeter <dynamic.person@will.change.com>
To: "Subject Will Change" <email@will.change.net>
Subject: Subject will change
Date: Mon, 17 Jun 2002 09:30:27 -0600
Other email stuff that no one needs..
Message will be here...
This will continue.. theres about 500 messages. My problem is that I cant make Regular Expressions if my life depends on it. Right now I am exploding the whole file by From constant-address@will.never.change.com this makes a very nice array.. and then I am going trying to parse that array, but I cant seem to retrieve the fields properly. Can anyone provide some code? I need the fields: To, Subject, Date and Message
I hope you understand.. I tried to color code it! :-)