需要使用代理发送消息(smtp),代码如下,代理完全被忽略,该怎么办?
Properties props = new Properties();
System.setProperty("mail.socket.debug", "true");
props.put("mail.socket.debug", "true");
if (_config.getIsProxy()) {
props.put("mail.smtp.socks.host", proxyHost);
props.put("mail.smtp.socks.port", proxyPost);
}
props.put("mail.smtp.timeout", _config.getTimeout()*1000);
props.put("mail.smtp.connectiontimeout", _config.getTimeout()*1000);
props.put("mail.smtp.ssl.enable", "true");
props.put("mail.store.protocol", "smtp");
props.put("mail.smtp.host", server);
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");