For finding the ip address of the smtp server in java? I cant find the right api method.
Thank开发者_Python百科 you
InetAddress addr = InetAddress.getByName(hostname);
See the docs. However, I'm not clear why you want to do this.
You must ask the system administrator as this is not standardized.
A frequent scenario on Linux-machines is that the machine itself knows how to send out mail. In that case you would use "127.0.0.1" as the SMTP host.
精彩评论