Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //persons.add(new Person("","[email protected]",1));
- String from = USER_NAME;
- String pass = PASSWORD;
- String[] to = new String[persons.size()];
- for(int i=0;i<persons.size();i++)
- to[i] = persons.get(i).getEmail(); // list of recipient email addresses
- String subject = "TESTUJEMY APKE";
- String body = new String();//= "Jak widzisz tego maila to znaczy, że apka do losowania już działa ! \nPozdrawiam :D ";
- ArrayList<Integer> numbers = new ArrayList();
- int i = 0;
- while (i < persons.size()){
- Random rand = new Random();
- int current_idx = rand.nextInt(persons.size());
- if(current_idx != persons.get(i).getNumber() && !numbers.contains(current_idx)){
- //body =
- System.out.println("Hohoho "+ persons.get(i).getName()+"! W tym roku trafił/a Ci się : " + persons.get(current_idx).getName());
- i++;
- numbers.add(current_idx);
- }
- }
- //sendFromGMail(from, pass, to, subject, body);
- }
Advertisement
Add Comment
Please, Sign In to add comment