SmtpMailSender extends AbstractMailClient implements MailSender { @Override public void send(Address[] recipients, MimeMessage message) throws MailClientException { try { MailUtils.sendMessage(recipients, getMailSession(), message); } catch (MessagingException e) { throw new MailClientException("Exception while sending message.", e); } } SmtpMailSender(Properties mailServerProps); @Override void send(Address[] recipients, MimeMessage message);  }
@Test @Ignore public void canSendMultipleMessages() { SmtpMailSender testMailSender = getTestSmtpMailSender(); try { Address[] recips = new Address[] {new InternetAddress(EMAIL_RECIP) }; for (int i = 0; i < NUMBER_OF_MSGS; i++) { testMailSender.send(recips, getMimeMessage(MESSAGE_FILEPATH)); } waitForIncomingMsg(NUMBER_OF_MSGS); } catch (Exception e) { fail(e.getMessage()); } assertEquals(NUMBER_OF_MSGS + " expected on server.", NUMBER_OF_MSGS, countRemainingMsgs()); }