Search The ForumSearch   RegisterRegister  LoginLogin

MailBee POP3

 AfterLogic Forum : MailBee POP3
Subject Topic: Insert to database Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Itzik
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 16 June 2005 at 6:32pm | IP Logged Quote Itzik

Hi Alex,
what is the best way to insert mail into database?
To insert it as one mail?
or to insert it divided (to,cc,subject,bodytext..)?

What is the code to insert it? I didnt find it in the documents.

Thank you,
Itzik
Back to Top View Itzik's Profile Search for other posts by Itzik
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 16 June 2005 at 6:50pm | IP Logged Quote Alex

As they say, it depends...

For example, our WebMail Pro application stores message headers and body in the databse while attachments are saved as files.

But it's possible to save entire messages into database.

Or, you can save message headers and general information like message size into database and also save entire message as files.

The decision is up to you. If you're MSSQL server user, you can store everything in database (for example, one table contains message headers, second - message bodies, third - attachment bodies). MS Access is not strong enough to maintain gigabyte databases so it would be better to have only message headers + body text in database and save attachments into files. In database, you can have table which links messages and attachments.

If you choose files-oriented approach (when messages are stored as .EML files), you can save/load messages to/from disk using ImportFromFile/SaveMessage methods. You can still have message headers duplicated in the database - this would allow you to efficiently display message lists, etc.

You can also save message body (in addition to message headers and general message information like message size, attachment file names and sizes, etc) in the database - this will also add full-text search capabilities to your mail engine. Still, when the message is accessed, you display it from .EML file.
I would prefer this approach if there are no other considerations.

Of course, you're free to implement your own techiques, for example, you can never store raw body (neither in .eml files nor in database) and store individual message parts only.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide