sender.setHost("host");
sender.setPort(30);
sender.setUsername("username");
sender.setPassword("password");
SimpleMailMessage simpleMessage = new SimpleMailMessage();
simpleMessage.setFrom("me@mail.org");
simpleMessage.setReplyTo("reply@mail.org");
simpleMessage.setTo("you@mail.org");
simpleMessage.setCc(new String[] {"he@mail.org", "she@mail.org"});
simpleMessage.setBcc(new String[] {"us@mail.org", "them@mail.org"});
Date sentDate = new Date(2004, 1, 1);
simpleMessage.setSentDate(sentDate);
simpleMessage.setSubject("my subject");
simpleMessage.setText("my text");
sender.send(simpleMessage);
assertEquals("host", sender.transport.getConnectedHost());
assertEquals(30, sender.transport.getConnectedPort());
assertEquals("username", sender.transport.getConnectedUsername());