Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How would you implement database updates via email?

I'm building a public website which has its own domain name with pop/smtp mail services. I'm considering giving users the option to update their data via email - something similar to the functionality found in Flickr or Blogger where you email posts to a special email address. The email data is then processed and stored in the underlying database for the website.

I'm using ASP.NET and SQL Server and using a shared hosting service. Any ideas how one would implement this, or if it's even possible using shared hosting?

Thanks

like image 323
jules Avatar asked Apr 01 '26 00:04

jules


2 Answers

For starters you need to have hosting that allows you to create a catch-all mailbox.

Secondly you need a good POP3 or IMAP library, which is not included AFAIK in the .NET stack.

Then you would write a Command Line application or a Service that regularly checks the mailbox, pulls messages, inserts content in db based on the "To" address (which is unique for each user), and then deletes the email from the mailbox.

It's feasible and sounds like fun. Just make sure you have all you need before you start!

like image 136
Sklivvz Avatar answered Apr 02 '26 13:04

Sklivvz


If the data is somewhat "critical", or at least moderately important, do NOT use their username as the "change-data-address". Example: You might be tempted to create an address like [email protected], but instead use [email protected] where you give them the random number if the visit the web-page. That way people can not update other peoples data just by knowing their username.

like image 36
Espo Avatar answered Apr 02 '26 14:04

Espo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!