@DataProvider public Object[][] testInfo() throws IOException { return new Object[][] { {"mail1@yandex.ru","password","mail2@yandex.ru","password2"}, {"mail3@yandex.ru","password3","mail4@yandex.ru","password4"}, {"mail5@yandex.ru","password5","mail6@yandex.ru","password6"}, }; } @Test(dataProvider = "testInfo") public void mailTest(String emailFrom,String passwordFrom,String emailTo,String passwordTo) throws IOException, MessagingException { Sender.send(emailFrom, passwordFrom, "mailSubject", "messsage", emailTo); . . . } } 

From the first to the second box it sends, and then it gives an error:

java.lang.RuntimeException: com.sun.mail.smtp.SMTPSendFailedException: 553 5.7.1 Sender address rejected: not owned by auth user. ;

nested exception is: com.sun.mail.smtp.SMTPSenderFailedException: 553 5.7.1 Sender address rejected: not owned by auth user.

    0