Link to home
Start Free TrialLog in
Avatar of dlbowman
dlbowman

asked on

Email Client

I am writing an Email client.  I am using the Delphi 4 Pop3, Smtp components.  I am able to get and send mail from the
server ok.  I would like to save the Emails / attachments
in a file of some sort, but have no knowledge of how to do this correctly.  I could really use a good example of the
write way to write mail to a file & be able to retreive
it again placing it into the correct folder, ie (inbox,
or other folders.. like outlook).

Any Suggestions would be Greatly Appreciated.
ASKER CERTIFIED SOLUTION
Avatar of dwwang
dwwang

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dlbowman
dlbowman

ASKER

Actually I am currently saving the Attachments locally.  I was interested in saving the
Email message to a local file, just the Outlook & Netscape do.  I would like to know
the best way to save Emails to a file & be able to extract them from the file when the
Email Client program is loaded.  Basically I would like to have the same functionality
as Outlook and Netscapes Email Clients.  Sorry if I posed the question wrong.

Thanks

Doug
Oops, sorry for misunderstanding your question.

I think it's a complex task, although may not be so difficult. You need to build database yourself to store most of the information of the mails. You know Outlok and Netscape mail all have their own non-standard databases for storage. However, you can use normal databases, such as paradox.

Here is an outline:

1. a mail message table, saveing all informations a that can describe a mail, you can refer to the TMailMessage structure in Delphi,
      MessageID, head, from,body,etc...

2. an Attachment table, with an ID field to refer to the mail message table,(hopefully you can use the MessageID in previous table). Then an attchament field, which should be a BLOB field, so that you can save the attachment using methods such as LoadFromStream, for whatever kind of file.

Teh relationship of the two tables is 1-n, since there can be multiple attachments per mail.

Hope this helps.
Regards,
Wang