Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Email Client

Posted on 1998-12-22
3
Medium Priority
?
244 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 600 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Loops Section Overview
Suggested Courses

963 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