Re: [問題] Javamail 使用proxy(需帳號密碼)

看板java作者 (._.)時間16年前 (2010/03/09 13:54), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串2/2 (看更多)
※ 引述《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
話說左上角的 Oracle 害我一直以為我跑錯網站...
03/09 14:05, 1F

03/10 06:55, , 2F
感謝說明!我也以為跑錯站,才想起合併案...
03/10 06:55, 2F
文章代碼(AID): #1BbUAklV (java)
文章代碼(AID): #1BbUAklV (java)