|
[Help | API Docs | Short Course| Exercises] In this exercise, create a program that creates a canned reply message and attaches the original message if it's plain text. PrerequisitesSkeleton CodeTasksThe skeleton code already includes the code to get the list of messages from the folder and prompt you to create a reply. When answered affirmitively, create a new Set the from field to your email address. Create the text for the reply. Include a canned message to start. When the original message is plain text, add each line of the original message, prefix each line with the " Set the message's content, once the message content is fully determined. Send the message. Compile and run the program, passing your mail server, SMTP server, username, password, and from address on the command line. Answer YES to the messages you want to send replies. Just hit 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 mail server, SMTP server, username, password, and from address):
java ReplyExample POP.Server SMTP.Server username
password from@address
You'll be prompted to reply to each of the messages in your INBOX. Enter
Next ExerciseExercisesAbout This Short CourseCopyright 1996-2001 jGuru.com. All Rights Reserved. | |||||
|
| ||||||||||||