I am using javamail for sending mail (SMTP protocol) as follows
String host = "smtp.gmail.com";
:
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.socks.host","sock_proxy_host");
props.put("mail.smtp.socks.port","sock_proxy_port");
Session session = Session.getInstance(props,new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("..", "..");
}
});
But the socks proxy i am using requires a basic authentication. I am trying to setting the credential as
System.setProperty("java.net.socks.username", "socks_username");
System.setProperty("java.net.socks.password", "socks_passwd");
Is there any other way to set the socks proxy username/password (using javamail API)?