This servlet will format an email form in HTML and,
when * the user submits the form, will mail the message using *
SMTP */ public class SendMailServlet extends
HttpServlet { public static String MAIL_FROM = "from"; public
static String MAIL_SUBJECT = "subject"; public static String MAIL_BODY =
"body";
// Multiple 'to' addresses can be separated by commas public static
String MAIL_TO = "karl@servletguru.com"; public static String MAIL_HOST =
"server1.electronaut.com";
/** *
Performs the HTTP GET
operation * * @param req The request from the client * @param
resp The response from the servlet */ public void
doGet(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, java.io.IOException { // Set the content type of
the response resp.setContentType("text/html");
// Get the PrintWriter to write the response java.io.PrintWriter
out = resp.getWriter();
// Create the HTML
form out.println(""); out.println("