Home > Articles > Programming > Java

  • Print
  • + Share This
From the author of


Java's Network API can be used to build many kinds of useful Java programs, including programs that send and receive email messages. In this article, you learned the anatomy of an email message and how to use SMTP and POP3 to send and receive email messages. You also learned about MIME's support for attachments, and you even saw how to incorporate an attachment into an email message.

Now that you have completed the final Network API article, what's next? For starters, consider reading the following articles:

The first article provides you with a quick introduction to Sun's JavaMail API. Once you've used JavaMail, you probably will never want to work with email at this article's low level. The second article offers an overview of MIME. You might find that the article adds clarity to various topics discussed in the MIME RFCs. (See the previous article for links to the MIME RFCs.) Tired of SPAM (as in unsolicited junk email)? The third article exposes the use of various email headers in SPAM activities, and shows you how to find out who is spamming you. Finally, the fourth article looks at email from the server-side servlet perspective.

Are you up for a challenge? Consider developing GUI versions of the SMTPDemo and POP3Demo programs. Begin by designing the GUI for each program. If you are not sure what that GUI should look like, take a look at an existing email program (such as Microsoft's Outlook Express). You might also consider creating high-level SMTP and POP classes, with appropriate send(), receive(), and other methods—to simplify writing code that deals with the SMTP and POP3 server programs. Keep in mind those rules that have previously been stated regarding to email message anatomy (including attachments) as you plan your code. Also read through the various RFCs that this article has highlighted. Once you successfully complete your GUI-based SMTPDemo and POP3Demo programs, try to combine those programs into one email program to send and receive email messages. Good luck!

In closing, if you have a Network API question and cannot find an answer, check out a Java networking FAQ—such as the networking FAQ found at http://www.faqs.org/faqs/computer-lang/java/network-programming/. Also review Sun's SDK documentation, and even look at the relevant SDK source code.

  • + Share This
  • 🔖 Save To Your Account