Java mail API smtp-host automatically converting into localhost

I have below API to send smtp email:

void sendSMTPMail(File emlFile)throws Exception {
        String host = "smtp.host";
        int port =25;
        Properties properties = System.getProperties();
        properties.put("mail.smtp.host", host);
        properties.put("mail.smtp.port", port);
        properties.put("mail.transport.protocol", "smtp");

        Session session = Session.getDefaultInstance(properties);
        InputStream source = new FileInputStream(emlFile);
        MimeMessage message = new MimeMessage(session,source);

        Transport.send(message);
    }

When Transport.send(message) tries to send email the mentioned host say “smtp.host” (some remote smtp host) automatically converting into localhost, and trying to make smtp connection at localhost, In some system its perfectly connecting with smtp.host but in some system its not.
error log from system where its not working:

smtp host: smtp.host(edited), port=25.
uri in select proxy: socket://localhost:25, host: localhost
Returning previousSelector (DIRECT), host: localhost
Unable to send smtp message. MessageID: <86717532.2.1501062622633>
MailMonitor$SendMailTask.run():215->MailMonitor$SendMailTask.sendSMTPMail():277>MailMonitor$SendMailTask.sendSMTPMail():277

There is one API which tries to find proxy mapped for this smtp host but that API is receiving localhost as parameter:

@Override
public List<Proxy> select(URI uri) {
    String host = uri!=null?uri.getHost():null;
    Logger.info("uri in select proxy: "+uri+", host: "+host);
    if (urlToProxyMap.containsKey(uri.getHost()))
    {
        final List<Proxy> proxies = urlToProxyMap.get(uri.getHost());
        //proxy = one suitable proxy
        ...
        return proxy;
    }
    else if (defaultProxy != null && uri.getScheme().toLowerCase().startsWith("http")) {
        Logger.info("Returning default proxy: "+defaultProxy+", host:"+host);
        return defaultProxy;
    }
    else
    {
        Logger.info("Returning previousSelector (DIRECT), host: "+host);
        return this.previousSelector.select(uri);
    }
}

It could be a weird question but any pointer would be helpful