<commit_before>package funWebMailer;

import java.util.List;
import java.util.Properties;

/**
 * Created by Bogdanel on 03.05.2017.
 */
public class FunWebMailer {

    private static final String sender = "<EMAIL>";

    private void sendTextMail(List<String> recipients, String subject, String text){
        //stub method
    }

}<commit_msg>Added implementation to send mail<commit_after>package funWebMailer;

import com.sun.org.apache.xpath.internal.operations.Mult;
import com.sun.xml.internal.ws.protocol.soap.MessageCreationException;

import javax.mail.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import java.util.List;
import java.util.Properties;

/**
 * Created by Bogdanel on 03.05.2017.
 */
public class FunWebMailer {

    private static final String from = "<EMAIL>";
    private static final String password = "<PASSWORD>";

    private static void sendTextMail(List<String> recipients, String subject, String text){
        Properties props = System.getProperties();
        String host = "smtp.gmail.com";
        props.put("mail.smtp.starttls.enable", "true");
        props.put("mail.smtp.host", host);
        props.put("mail.smtp.user", from);
        props.put("mail.smtp.password", password);
        props.put("mail.smtp.port", "587");
        props.put("mail.smtp.auth", "true");

        Session session = Session.getDefaultInstance(props);
        MimeMessage message = new MimeMessage(session);

        try {
            message.setFrom(new InternetAddress(from));
            InternetAddress[] toAddress = new InternetAddress[recipients.size()];

            for(int i = 0; i < recipients.size(); i++){
                toAddress[i] = new InternetAddress(recipients.get(i));
            }

            for( int i = 0; i < toAddress.length; i++) {
                message.addRecipient(Message.RecipientType.TO, toAddress[i]);
            }

            message.setSubject(subject);
            message.setText(text);
            Transport transport = session.getTransport("smtp");
            transport.connect(host, from, password);
            transport.sendMessage(message, message.getAllRecipients());
            transport.close();
        } catch (MessagingException me) {
            me.printStackTrace();
        }

    }
}
{'fraction_non_alphanumeric': 0.12348262871494349, 'fraction_numerical': 0.008790288823775638, 'mean_word_length': 2.886178861788618, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4666562', 'n_tokens_mistral': 705, 'n_tokens_neox': 659, 'n_words': 148}