开发者

email application design, how to manage attachments and messages?

I am doing an email application which will allow multiple attachments and emails will be send on schaduled date. I have some desgining issues here. Please guide me with your expereienced knowledge.

Email will be stored in db table but attachments will be stored in a folder on server. User will upload files first later his email will be stored in db. I have messages and attachments tables. But there are some cases which system should be able to handle.

  1. How I should store attachments of emails of different users (in one folder or in multiple folders) ?
  2. How attachment naming should be manged, more then one attachments (by one or different users) can have same n开发者_如何转开发ame ?
  3. User can upload files but later can leave composing message, how system will handle such atachments ?
  4. What will be best time to save email message in db table on user button (save or draf) press or compose page request ? If you suggest on page request then how to handle messages that were not successfully finished ?

Plase guide if I am missing any thing else.

I will be more thankful for your guidance, time and sincere advice.


You have a couple of choices on storage of drafts:

  1. Separate draft table (or set of tables)
  2. Mark message as draft

If drafts can be auto-deleted after some time, the first is easier. It may also be easier to handle the programming to keep it isolated, but flagging the email message in the database as draft works, as well.

When to save? I would save both drafts and ready to send emails, as there is too much risk of losing them if you don't persist them and persistence to a common location is nicer.

Multiple files with same name? Either you physically separate the user's items into different directories or you change the name of the file and store the name it should have as an attachment and have it "renamed" back when the email is sent.

How to handle attachments of emails never properly composed? that is a business decision, not a technical one. Whatever you choose, the user should know the rules.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜