How do you send mail using the JavaMail API through a proxy server?

John Zukowski

If you're "proxying" SMTP, what you're really doing is just running an SMTP relay on the firewall box. You would need to put different rules for incoming versus outgoing in the firewall.

Keep in mind that (normally) a proxy only forwards HTTP requests. You would need to setup a socks gateway to connect to the mail server, but it requires a socks server installed somewhere in your network.