How to dynamically get mail server (host) IP address
Hi,
I am sending mails using JavaMail API, its working fine. I had hard coded the mail server "Host" IP address. But the mail server IP changes frequently , perhaps this is done to block spamming. My question is , is there any way to get the mail server's IP dynamically so that my mail continues to work. My mail stops going when the "Host" IP changes. Plz help me its urgent.
Regards,
Devom
[418 byte] By [
devoma] at [2007-10-3 4:22:04]

Does the SMTP server have a name? And does your DNS keep up with changes to its address? If so, then use the name instead of the IP address. By the way this has nothing to do with JavaMail. It's just ordinary networking. Talk to the people in charge of that network if you have that sort of question.
I have a notebook with wireless network connection. When I travel around the world, I would like to send email messages out from my java program running on my notebook.
Then I need to get the mail server name or IP address dynamically. Any body knows how to do it?
Thanks,
Jiping
Generally you're going to want to use a fixed mail server, one that is
provided by your ISP and that knows about you and authorizes
you to use it to send mail. Unlike, say, DNS servers, you're unlikely
to find a random mail server that's going to let anyone connect to it
and send mail. (If such a server exists, it should be shut down
immediately before it's used as a source of spam.)