It should be possible, but you'll need to write your own SocketFactory and configure JavaMail to use it. The
SocketFactory will need to make the connection through the HTTP proxy
server using the HTTP CONNECT protocol command, then turn the socket over
to JavaMail for use. You'll probably need to write the HTTP protocol
support yourself, rather than using HttpURLConnection.
Alternatively, there are some programs that act as a SOCKS proxy server
and forward messages through a web proxy server. You can then use the
SOCKS support in JavaMail.