magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 2000 > 12 > Java@Work  

Mail Bonding

By Al Williams

In my February 2000 column, I showed several methods that allow an applet to send email. The method I thought was most effective was to use a server-side program to send messages. This circumvented any possible difficulties with users behind firewalls, or client-side email program peculiarities.

Recently, I wanted to build a Web-based email list for a group of developers collaborating on a project. The project already has a set of Web pages, and I wanted a page on which you could select a group of people, enter a message, and mail it. Sure, most email programs let you send to groups, but then everyone has to keep their group lists current. A dedicated list server is another option, but I wanted to make a Web-based solution that uses Java.

In the February column, I mentioned that you could write Java code to open up a Simple Mail Transfer Protocol (SMTP) server and directly send mail. For an applet, this presupposes that the SMTP server is on the same server as the applet, and that the user is able to connect to it (many firewalls and ISPs block SMTP access to unknown hosts).

However, code running on the server side should have no problems opening a socket to an SMTP host. I decided to write a reusable object that could handle the SMTP part so that I could use it from Java programs, applets, or server-side Java (like a JSP page). Because this issue's focus is on collaboration, I also wanted to document the SMTP object using the Javadoc tool that generates HTML documentation for Java source code.

Inside SMTP

When you send email, you connect to an SMTP host computer on port 25.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2