How to implement database updates via email?

I am creating a public website that has its own domain name with pop / smtp email services. I’m considering giving users the opportunity to update their data via email - something similar to the functionality found on Flickr or Blogger, where you send emails to a special email address. The email data is then processed and stored in the base database for the website.

I use ASP.NET and SQL Server and use shared hosting. Any ideas on how to implement this, or if it is possible even with shared hosting?

thanks

+3
database email
source share
6 answers

First you need to have a hosting service that allows you to create a mailbox for everyone.

Secondly, you need a good POP3 or IMAP library that is not included by AFAIK on the .NET stack.

Then you have to write a command line application or service that regularly checks the mailbox, pulls out messages, inserts content in db based on the To address (which is unique to each user), and then removes the email message from the mailbox.

It is doable and sounds fun. Just make sure you have everything you need before you begin!

+3
source share

If the data is somewhat “critical” or at least moderately important, DO NOT use their username as “change data address”. Example. You might be tempted to create an address like username@domain.com , but use username-randomnumer@domain.com instead, where you give them a random number if you visit a web page. Therefore, people cannot update other people's data simply by knowing their username.

+2
source share

Email can be trivially tampered with. I would only do this if you can handle PGP / SMime certificates in your application.

Other than that, I see no reason why not!

+1
source share

use dotcl popclient to read incoming emails, analyze them for everything you expect, and paste the data into the database.

see the codeproject website for a simple popclient implementation you would need to independently determine the contents of the email, for example, only data, payload for sql statements, etc.

0
source share

You can also identify the user based on the sender address. Here's how Tripit does it (and possibly others). This requires only one email address at your end.

0
source share

I did something similar using the Lumisoft IMAP client and scheduling a task in my application that checks every x minutes for the configured mailing address for updates. For planning, I recommend quartz.net . No triggering of external processes or anything else.

0
source share

All Articles