Solved

Email Client

Posted on 1998-12-22
3
236 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
creating manifest for my dll that called from activex 6 114
Mydac connection data base issue 3 157
code issue 8 130
QRReport  TQrmemo vertical stretching 1 46
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 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