O'Reilly logo

Sams Teach Yourself J2EE™ in 21 Days by Peter Roxburgh, Andy Longshaw, Debbie Law, Dan Haywood, Martin Bond

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sending a First E-mail

This section introduces you to the core classes you need to send an e-mail message. Specifically, you will use these classes to write code that accepts a SMTP host and mail recipient from the command line, and then sends a plain text e-mail to that recipient.

Although the application uses the command line, you can modify the code for use in other situations if you want. For example, you could modify the code so that it accepts parameters from another application or presents the user with a desktop or applet GUI written using Swing or AWT.

Creating a First E-mail

Now that you have set up your development environment, you can write the code that will send an e-mail message. This application uses classes from the javax.mail ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required