For Programmers: Free Programming Magazines  


Home > Archive > Java Help > October 2004 > Java ip dns email host









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

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/
________________________________________
_______________

Thomas Schodt

2004-09-24, 4:03 pm

WERNOTKIN wrote:

> Any other suggestions?


<http://www.dnsjava.org/>
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"});

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com