Jump to content

Database Design - Email Like Application


redbrad0

Recommended Posts

I am trying to build a web based email like application and I can not seem to get my head wrapped around the best database layout. Below I have some of the basic ideas of the database. There will not be multiple folders that emails can be stored in, but more of just a inbox and outbox. I would like to be able to Reference which emails responses are from so that is why I have the ParentMessageID (Used really for the outbox). What if the email is sent to more then one email address, would I store them all in the column or would it be better to link another table with the email address's? Can anyone see anything I am missing? Sure doesn't seem like I have everything.

 

Messages
Message_ID
Message_ParentMessageID
Message_Subject
Message_Body
Message_DateTime
Message_From
Message_To
Message_CC
Message_BCC
Message_Folder enum('Inbox','Outbox')

Message_Attachment
MessageAttachment_ID
MessageAttachment_MessageID
MessageAttachment_FileName
MessageAttachment_FileNameSaved
MessageAttachment_FileSize

Link to comment
https://forums.phpfreaks.com/topic/106814-database-design-email-like-application/
Share on other sites

  • 2 weeks later...

Sounds like you answered your own question.

 

1 Email -> 5,000 people should store:

 

The email,

The fact that it was sent (successful|failed) to 5,000 people.

 

Table Person (

Id

.

.

)

 

Table Email (

  Id

  Originator_Id -- Person.Id (index here.)

  Content

  Attachments

)

 

Table Sent_Email (

  Recipient -- Person.id

  Email -- Email.Id (index here.)

  Status -- 0 success, 1 fail, 2 unkown

)

  • 1 year later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.