Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a web host that supports cPanel and email addresses. I'm interested in creating a web app that checks for email messages, reads their contents and then does something with them, like interact with a database.

For example, Bob with email bob@gmail.com links his email address to his account on my web app. He sends an email to storethis@webapp.com with subject "Shopping List" and message "Apples, bananas, kiwis, milk", along with an attachment. The web app receives this email, and then parses the email's contents and stores this data into a database.

How can I implement this?

share|improve this question
1  
Do remember that anyone can spoof the from field, so you shouldn't design a system this way if there's any potential for benefit by third parties, or potential for serious harassment to your clients. If there is, you probably need something more secure than email. –  Theodore Murdock Mar 23 '13 at 4:15
    
If you're working in a unix environment, then it seems to me that the logical approach is for your web-server to interact with a cli email client to programatically read and respond to email based on input from http clients. –  Racheet Jun 3 '13 at 16:50

1 Answer 1

Java has JavaMail, which is a complete API for email servers and services. You could run a small java application which listens for the messages, processes them and acts accordingly (writing to a database, etc). It doesn't have to be a Web application per se, just some Java Beans which use the JavaMail API to register with the email service.

http://www.oracle.com/technetwork/java/javamail/index.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.