@@ -0,0 +1,1853 @@
+package asdff;%0A%0Aimport java.util.*;%0Aimport javax.mail.*;%0Aimport javax.mail.internet.*;%0A%0A// http://stackoverflow.com/questions/46663/how-can-i-send-an-email-by-java-application-using-gmail-yahoo-or-hotmail%0Apublic class GmailEmailer %7B%0A  private static final String HOST = %22smtp.gmail.com%22;%0A  private static final String PORT = %22587%22;%0A  %0A  private final String username; // GMail user name (just the part before %22@gmail.com%22)%0A  private final String password; // GMail password%0A%0A  public GmailEmailer(String username, String password) %7B%0A    this.username = username;%0A    this.password = password;%0A  %7D%0A  %0A  public void sendEmail(List%3CString%3E recipients, String subject, String body) %7B%0A    sendFromGMail(recipients, subject, body);%0A  %7D%0A%0A  private void sendFromGMail(List%3CString%3E to, String subject, String body) %7B%0A    Properties props = System.getProperties();%0A    props.put(%22mail.smtp.starttls.enable%22, %22true%22);%0A    props.put(%22mail.smtp.host%22, HOST);%0A    props.put(%22mail.smtp.user%22, username);%0A    props.put(%22mail.smtp.password%22, password);%0A    props.put(%22mail.smtp.port%22, PORT);%0A    props.put(%22mail.smtp.auth%22, %22true%22);%0A%0A    Session session = Session.getDefaultInstance(props);%0A    MimeMessage message = new MimeMessage(session);%0A%0A    try %7B%0A      message.setFrom(new InternetAddress(username));%0A%0A      // To get the array of addresses%0A      for(String t : to) %7B%0A        message.addRecipient(Message.RecipientType.TO, new InternetAddress(t));%0A      %7D%0A%0A      message.setSubject(subject);%0A      message.setText(body);%0A      Transport transport = session.getTransport(%22smtp%22);%0A      transport.connect(HOST, username, password);%0A      transport.sendMessage(message, message.getAllRecipients());%0A      transport.close();%0A    %7D catch (AddressException ae) %7B%0A      ae.printStackTrace();%0A    %7D catch (MessagingException me) %7B%0A      me.printStackTrace();%0A    %7D%0A  %7D%0A%7D%0A

Create GmailEmailer.java