Send email from java through proxy

I used the Java Mail API to send emails and receive them. Now the place where I am doing this project has a proxy server.

Can I learn how to send an email from java through a proxy server?

+3
source share
1 answer

See FAQ here

JavaMail does not currently support access to mail servers through a web proxy server. One of the main reasons for using a proxy server is to allow HTTP requests from the corporate network to pass through the corporate firewall. The firewall, as a rule, blocks most access to the Internet, but allows you to skip requests from the proxy server. In addition, the mail server within the corporate network will perform a similar function for e-mail, receive messages via SMTP and forward them to the final destination on the Internet and receive incoming messages and send them to the corresponding internal mail server.

- SOCKS V4 V5 (http://www.socks.nec.com/aboutsocks.html, RFC1928) , , Java TCP SOCKS. . socksProxyHost socksProxyPort. , JavaMail. , : java -DsocksProxyHost=myproxy .... SMTP, IMAP POP3- JavaMail - SOCKS. , TCP - SOCKS, .

SOCKS, JavaMail , , . JavaMail - - HTTP.

+1

Source: https://habr.com/ru/post/1794992/


All Articles