I have a situation where an old Email client is being retired. That client stored email in folder structures. Each Email is a separate file which I believe remains in the POP3 format in which it was downloaded. The goal is to treat the Email as a company resource that can be accessed by anyone who has a need to see it.
I am thinking of several options and open to suggestions:
- Process the contents of each folder into an individual text file and store that file on the local server where appropriate users can see it. - Process the contents of a folder into a format that can be imported into a company generic Gmail account along with an origin label. Users with the proper clearance could then access the original Email from the generic account.
I assume that I am not the first person dealing with this situation. The simplest solution might be something off the shelf that does not involve coding at all. Otherwise - I know the text portion of the files is easily manipulated in VFP. Handling attachments may be much more difficult. I have no experience in interfacing with Gmail.
Ultimately I would like to allow a user with a Gmail account to apply a specific label to an Email in her/his environment and have that Email automatically copied to the appropriate generic company email account. This would put information that others need where they can see it without copying multiple people. It should allow deleting a users account without loosing company information.
Any input welcome!
Thanks in advance,
Joe
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
Joe,
A couple of observations...
POP3 is a communications protocol for transferring email messages between server and client (and vice versa). The other protocols being IMAP and Exchange among others.
I suspect the emails are in what I call EML format which is technically MIME RFC 822 which was kind of standardized by Microsoft Outlook Express "back in the day."
If it is EML format, you can pretty easily chop it up into the pieces that can be used to display the entire message in a VFP form (if that's your goal.)
Here's some code from a form I use in one of my applications that allows the user to view an EML file.
with thisform lcFile = GETFILE('eml','Select email file','Open',1,'Email Viewer') test=FILETOSTR(lcFile)
lcTo=STREXTRACT(test,'To: ',CHR(13),1,1) .lbTo.caption=ALLTRIM(lcTo)
lcfrom=STREXTRACT(test,'From: ',CHR(13),1,1) .lbFrom.caption=ALLTRIM(lcFrom)
lcdate=STREXTRACT(test,'Date: ',CHR(13),1,1) .lbDate.caption=ALLTRIM(lcDate)
lcsubject=STREXTRACT(test,'Subject: ',CHR(13),1,1) .lbSubject.caption=ALLTRIM(lcSubject)
LOCAL lcShow lcShow=SYS(3)+'body.mht' STRTOFILE(test,ADDBS(GETENV("TEMP"))+lcShow)
WITH .oBody .navigate(ADDBS(GETENV("TEMP"))+lcShow) .document.DesignMode = 'on' .silent=.t. ENDWITH ENDWITH
Obviously there is a form, with a few labels (lbTo, lbFrom, lbDate, lbSubject) and an OLE IE explorer object for displaying the HTML body of the email (oBody)
Try it out, it works pretty well for my needs. Mike
Joe Yoder wrote:
I have a situation where an old Email client is being retired. That client stored email in folder structures. Each Email is a separate file which I believe remains in the POP3 format in which it was downloaded. The goal is to treat the Email as a company resource that can be accessed by anyone who has a need to see it.