SQL Server Performance Forum – Threads Archive
How to store email in database?Is there a way to store email in a database table? Also, how do I enable email to be sent from SQL Server? Thanks.
Answering to ur second question first
to save the emails to sql server tables,
need some information, do you want to save the email which are recived to your out look. there are ways you can read your outlook, you can get teh details of sender , recevier which you can save them in a varcahr field which ou can save the sent or received datetime in datetime filed. you can save the body in a text field.
quote:Originally posted by artfuldodger Is there a way to store email in a database table? Also, how do I enable email to be sent from SQL Server? Thanks.
I think what I need for sending mail is really like an alert if something is wrong or scheduled?
I started by storing E-Mails (yes, that’s the official (ridiculous) German writing by taking this complex data type into its pieces and storing this pieces in separate columns. This works fine as long as you don’t need to put the pieces back together again.
I changed it now to store one single BLOB object in an IMAGE column. I use this here from within Outlook to store mails in Outlook’s *.msg format. The advantage here is, you don’t need to care about how to open it. So, depending on what you want to do, I would suggest one single IMAGE column. The actual storing and retrieving is pretty easy when you use ADO and its stream object. Have a look here:
SQL Server MVP
Thanks Frank. That seems to be what I need for storing the email. Is there anything I need to do to enable SQL Server to send email alerts, etc?
I don’t use SQL Mail myself, but here are some good articles in the MS knowledgebase:
SQL Server MVP