I'm not a mail expert but don't you have to look up the MX host rather
than just presuming that the domain name is the mail host?

If you're not getting the recipient address from an email I think
this is what you'll have to do.

Anyone know of an easy way to do an MX lookup?



Nic Ferrier
Tapsell-Ferrier Ltd
www.tapsellferrier.co.uk


>>> Rolando Salangsang <[EMAIL PROTECTED]> 3/10/99 8:33:19 PM >>>
Hello,

I have an servlet that emails a confirmation message to a user after
a they
fill out a form. All seems to be working OK except for some
"UnknownHost"
Exceptions on some email addresses.

I use the following sample code to obtain the host of the recipient:

int indexOfAtSign = recipientAddress.indexOf('@');
String host = recipientAddress.substring(indexOfAtSign + 1);

I make a socket connection to the target as follows:
Socket s = new Socket(host, SMTP_PORT);

My questions are in regards to the recipient's email address:
1. If I try to test mail someone at <username>@notes.seagate.com, I
will get
an unknown host exception.
2. Am I missing something that a commercial email client does to the
recipient's address? I can send this same message to the same address
as
question 1. without a problem.

Any tips/ideas would be appreciated

Thanks
Rolando

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in
the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html

Resources:
http://java.sun.com/products/servlet/external-resources.html

LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to