Re: [問題] Javamail 使用proxy(需帳號密碼)
※ 引述《dada0103 (排球第一)》之銘言:
: 請問各位前輩們:
: 搜尋一下 javamail 設定 proxy 大多都只有指定
: proxyhost
: proxyport
: 如果我的proxy環境還需要使用帳號密碼登入 proxy
: 應該使用什麼做設定呢?
: Properties props = System.getProperties()
: props.setProperty("proxySet","true");
: props.setProperty("ProxyHost","IP");
: props.setProperty("ProxyPort","PORT");
: 是用 setProperty 還是用 put呢?
: 懇請前輩們指點~
http://java.sun.com/products/javamail/FAQ.html
Q: How do I configure JavaMail to work through my proxy server?
A: JavaMail does not currently support accessing mail servers
through a web proxy server. One of the major reasons for using a
... (略)
If your proxy server supports the SOCKS V4 or V5 protocol
(http://www.socks.nec.com/aboutsocks.html, RFC1928) and allows
anonymous connections, you can tell the Java runtime to direct
all TCP socket connections to the SOCKS server. See the Networking
Properties guide for the latest documentation of the socksProxyHost
and socksProxyPort properties. These are system-level properties,
not JavaMail session properties. They can be set from the command
line when the application is invoked, for example:
java -DsocksProxyHost=myproxy .... This facility can be used to
... (略)
Without such a SOCKS server, if you want to use JavaMail to
directly access mail servers outside the firewall, the firewall
will need to be configured to allow such access. JavaMail does not
support access through a HTTP proxy web server.
--
官方文件如是說
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.160.34.52
→
03/09 14:05, , 1F
03/09 14:05, 1F
推
03/10 06:55, , 2F
03/10 06:55, 2F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):