I have written E-Mail stuff in JSP,ASP and PHP.It is not hard though.
What you should do is to first select the protocol: IMAP, POP/SMTP and you
can easily find some good samples.
If you want to work with folders and lots of things you'd better go with
IMAP.
If you want to manage web-applications via email it is upto you to do the
stuff.
Use words like : IMAP JSP SAMPLE ...
also there is a book from WROX which you can find a sample chapter
online, even that is great.
In ASP there is special ojbect which can work with email easily.
I have done those folder stuff and IMAP with PHP, as always PHP is a
magic: EASY and HANDY