Java Programming Home Page: Archive: Message #109

Date: Oct 28 2000 07:59:48 EDT
From: "Java Programming" <javaProgramming-owner@listbot.com>
Subject: sw409 midterm question

A student writes:
Dr. Lyons,

We need (I think) a SMTP server to successfully send the email 
required in
      the midterm project.  Can we use www.docjava.com for this?

ANS: Yes, here is a sample:
> telnet www.docjava.com 25
Trying 24.191.32.175...
Connected to docjava.dhs.org.
Escape character is '^]'.
help
220 linux.docjava.com ESMTP Sendmail 8.9.3/8.8.7; Sat, 28 Oct 
2000 07:50:11 -0400
214-This is Sendmail version 8.9.3
214-Topics:
214-    HELO    EHLO    MAIL    RCPT    DATA
214-    RSET    NOOP    QUIT    HELP    VRFY
214-    EXPN    VERB    ETRN    DSN
214-For more info use "HELP <topic>".
214-To report bugs in the implementation send email to
214-    sendmail-bugs@sendmail.org.
214-For local information send email to Postmaster at your site.
214 End of HELP info

The student also asks:
In your example you have:
      if (serverHostName == null) serverHostName = 
getCodeBase().getHost();

      Is this a way to get a SMTP server?  I am not sure where 
these
      methods come from.

Ans:The methods come from the Applet class
and obtain the web host name.