This kind of thing should not be done in JSP pages (which are a templating technology to create text output, not a way to conduct actual processing). In a servlet or backing bean you can use the JavaMail API to access your mail server.
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades: