|
[Help | API Docs | Short Course| Exercises] In the last exercise you sent a mail message using the demonstration program provided with the JavaMail implementation. In this exercise, you'll create the program yourself. PrerequisitesSkeleton CodeTasksStarting with the skeleton code, get the system Add the name of your SMTP server to the properties for the Get a Create a Set the from field of the message. Set the to field of the message. Set the subject of the message. Set the content of the message. Use a Compile and run the program, passing your SMTP server, from address, and to address on the command line. Check to make sure you received the message with your normal mail reader (Eudora, Outlook Express, pine, ...). Where help exists, the task numbers above are linked to the step-by-step help page. Solution SourceDemonstrationAfter executing the following command (replacing the email addresses and specifying your SMTP server): java MailExample SMTP.Server from@address to@address your program will send a mail message. Next ExerciseExercisesAbout This Short CourseCopyright 1996-2001 jGuru.com. All Rights Reserved. | ||||
|
| ||||||||||||