Just to make it perfectly clear, the mail would be
in response to the HTTP request, it would not be
the response (which must be HTTP, obviously).
You'd need a mail server (or at least an SMTP server), and then you can use the JavaMail API to send mails. The
http://faq.javaranch.com/java/JavaEnterpriseEditionFaq page contains many useful links regarding JavaMail, including extensive tutorials and sample code.