View Full Version : Emailing into a Database!


Molly
04-10-2006, 01:59 AM
Hi

on our server we are looking to set it up so that emails that are address to a certain email address somehow get inserted into a row in a SQL server database. But we have been scratching our head for quite some time now and the best thing we can come up with is paying some on to copy and paste them in manually. Does anyone know of a better way? I think we have to stick to micrsoft mail server as well.

An advice would be greatly recieved.

jlknauff
04-10-2006, 07:47 AM
You will have to make a script and run it as a cron job. Don't ask how because I can't answer it, but someone else may be able to ;)

Paz
04-14-2006, 12:32 AM
I have an asp email mailing script that I use to send hotel special offers to clients. You can add/remove new clients or mark them as "inactive". It uses an MS Access database though rather than SQL - could you modify it? Send me a PM if you are interested.

Cheers,
Paz.

jedicoder
05-09-2006, 07:44 AM
The answer could be with your email client. If you use Outlook for an email client, it's programmable. It's object model is not easy however. I haven't done what you ask, but I've customized other Microsoft Office apps like Powerpoint and Word. It's called VBA code. I hope this gives you ideas.

dilligaf
05-09-2006, 08:29 AM
An email that adds a record to a data base?

Raspberry
05-15-2006, 09:44 AM
[QUOTE=Molly]Hi

on our server we are looking to set it up so that emails that are address to a certain email address somehow get inserted into a row in a SQL server database. But we have been scratching our head for quite some time now and the best thing we can come up with is paying some on to copy and paste them in manually. Does anyone know of a better way? I think we have to stick to micrsoft mail server as well.

An advice would be greatly recieved.[/QUOTE]

ive never done this on a MS machine, but on linux:

1. use an alias to pipe the email address to a script
something@here.com | /home/site/www/email_input.php

2. use stdin() in email_input.php to grab the contents of the email

3. use pear:Mail_Mime (http://pear.php.net/package/Mail_Mime) to parse the email into digestible sections plain text, rtf, html, attachemnts etc.

4. insert relevant parts into the db

I created a proof of concept a long time ago so i could see if i could make a site that would allow me to upload images via email. It works, most of the time, RC (http://www.raspberrycripple.com)

BSolveIT
05-29-2006, 05:28 PM
The answer you want is within SQL Mail on SQL Server 2000.

You need to setup the SQL Mail and SQL Agent mail. Once done, you can even fire queries at your database via email, to which the SQL Server will email you the results - completely automatically.

Anyway, once your got SQL Mail setup, you just need to decide what you want SQL Server to do when it recieves the emails in question. I normally do it with triggers.

Here's a link to set you on the right road (SQL Server will do everything you need):

http://www.databasejournal.com/features/mssql/article.php/3345091

8-|