Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- persons.add(new Person("Piotrek","p1otrek239922@gmail.com",0));
- persons.add(new Person("Michał","michal.latus@gmail.com",1));
- persons.add(new Person("Ola","mann.aleksandra@gmail.com",2));
- persons.add(new Person("Weronika","weronika@xgen.pl",3));
- persons.add(new Person("Heska","heska96@gmail.com",4));
- persons.add(new Person("Filip","filip.karolczak@gmail.com",5));
- persons.add(new Person("Rafał","rafaa1994@gmail.com",6));
- persons.add(new Person("Paweł","Pawelczykesik@gmail.com",7));
- //persons.add(new Person("","michal.latus@gmail.com",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
Advertisement