Solved

Email Client

Posted on 1998-12-22
3
233 Views
Last Modified: 2010-04-04
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.
0
Comment
Question by:dlbowman
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
dwwang earned 200 total points
ID: 1352620
Well, actually the processing of attachment is quite easy:

For sending attachments, you only need to provide the filenames, here is an example:
NMSMTP1.PostMessage.Attachments.AddStrings(AttachmentsField.Lines);
where AttachmentsField could be a memo, listing all file names selected by the user of you software.

For receiving attachments, you need simply indicate the directory that the pop3 component should save the attachments to, below is an example:
NMPOP31.AttachFilePath := '.'; this will save the attachments to current directory.

Regards,
Wang
0
 

Author Comment

by:dlbowman
ID: 1352621
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
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1352622
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

0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now