Friday, February 24, 2012

How to store an email on SQL server 2000?

Is it possible to store an email in SQL server 2000? Do we need to define our own data type for that, if yes then how? or do we have to store it as an object, again how? I want to save email after sending it by my ASP .NET application and then retrieve it at a later stage......Anyone please help?

You could create a new email table and just log to it every time you send. That is what we do. Below is our table schema.

Email_Log
-----
ID int Not Null
From varchar(100) Not Null
To Text Not Null
CC Text
BCC Text
Subject varchar(250)
Body Text
CreatedDate DateTime

|||

Email_Log
-----
ID int Not Null
From varchar(100) Not Null
To Text Not Null
CC Text
BCC Text
Subject varchar(250)
Body Text
CreatedDate DateTime

We can only use this schema when the email body is plain text without pictures or formatting information. I would suggest storing the email body using binary files. Or we can store the email body on a file server, while keeping a link in the table which points to the location where the email is stored.

Hope my suggestion helps

No comments:

Post a Comment