Check out this class for a quick and easy way of sending mail. It
uses your own mail server as has been suggested by others.

http://www.developer.com/journal/techworkshop/SendMailServlet.java

Rod McChesney, Korobra Corporation


Rolando Salangsang wrote:
>
> Before I jump into the Java Mail APIs and just for curiosity sake, I too
> would like to know if anyone knows how to do an MX lookup.
>
> Thanks again for the responses,
> Rolando
>
> > ----------
> > From:         Nic Ferrier[SMTP:[EMAIL PROTECTED]]
> > Reply To:     A mailing list for discussion about Sun Microsystem's Java
> > Servlet API Technology.
> > Sent:         Wednesday, March 10, 1999 1:01 PM
> > To:   [EMAIL PROTECTED]
> > Subject:      Re: e-mail
> >
> > 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
> >
>
> ___________________________________________________________________________
> 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