Lab 4b

Due TBA

    1. Implement a program that repeatedly (in a loop) prompts the user for an email address and sends a pre-configured message to each address entered by the user. The user should be able to quit the program by entering a value (such as 0 or 'quit') to end the loop. Hints:
      1. You need to add two properties to the Properties object you create (see the Project 2 description). The Properties object is essentially a HashMap that stores key, value pairs representing relevant properties associated with the message. The first property you need to set is the mail server. The key for this property should be "mail.smtp.host" and the value should be "smtp.usfca.edu". The second property you need to set is the sender. The key for this property should be "mail.from" and the value should be your email address.
      2. You will need to import the following classes:
        1. import java.util.Date;
        2. import java.util.Scanner;
        3. import java.util.Properties;
        4. import javax.mail.Message;
        5. import javax.mail.MessagingException;
        6. import javax.mail.Session;
        7. import javax.mail.Transport;
        8. import javax.mail.internet.MimeMessage;

Submission

Please submit your work in an SVN directory https://www.cs.usfca.edu/svn/<username>/cs112/lab4b.

Submission Instructions