If you have no clue then you're out of luck. I suggest you hire somebody who does, if you need the code written.
Or alternatively, you could get started with your project and ask a specific question about a problem you're having. That's the only kind of thing that people on forums can deal with.
Exactly. We can't just sit down and write you a tutorial based on the fact
that you don't know where to get started. If you want quick responses, you
have to show what you've already tried and why it doesn't work, and ask
a specific question.
What part of that is confusing you? The "automatically" part? What do you mean by "automatically"?
Normally you'll need a server program running and polling the INBOX for the return receipt address
for new messages.