| Author |
Java ip dns email host
|
|
| WERNOTKIN 2004-09-17, 9:01 pm |
| I am trying to setup an smtp server. I need a way to associate
bob@yahoo.com with yahoo's smtp server smtp.a2.yahoo.net or something.
I know that a dns server keeps an MX record to record a server for
email. I just need a way to translate @yahoo too smtp.a2.yahoo.net.
I tried using java.net.InetAddress.getByName("bob@yahoo.com")
Any other suggestions?
| |
| WERNOTKIN 2004-09-17, 9:01 pm |
| I don't know why it shows bxb@yxahxxo.xom it should be "bob@yahoo.com"
| |
| WERNOTKIN 2004-09-17, 9:01 pm |
| NOT bob@yahoo.com bob @ yahoo . com
| |
| Yu SONG 2004-09-24, 8:59 am |
| WERNOTKIN wrote:
> I am trying to setup an smtp server. I need a way to associate
> bob@yahoo.com with yahoo's smtp server smtp.a2.yahoo.net or something.
> I know that a dns server keeps an MX record to record a server for
> email. I just need a way to translate @yahoo too smtp.a2.yahoo.net.
>
As you said, you need to connect to a DNS server to get the MX record.
I found it was easier to do this by using C/C++.
--
Song
/* E-mail.c */
#define User "Yu.Song"
#define At '@'
#define Warwick "warwick.ac.uk"
int main() {
printf("Yu Song's E-mail: %s%c%s", User, At, Warwick);
return 0;}
Further Info. : http://www.dcs.warwick.ac.uk/~esubbn/
________________________________________
_______________
| |
|
|
| WERNOTKIN 2004-10-27, 3:58 am |
| I found out how!!! JNDI!!!
DirContext ictx = new InitialDirContext(env);
Attributes attrs1 = ictx.getAttributes("host1", new String[] {"MX"});
|
|
|
|