Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 links his email address to his account on my web app. He sends an email to 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
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

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.

share|improve this answer

Your Answer


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.