@Override public void sendMail(MimeMessage message) throws MessagingException {
  MailAddress sender=new MailAddress((InternetAddress)message.getFrom()[0]);
  Collection<MailAddress> recipients=new HashSet<MailAddress>();
  Address addresses[]=message.getAllRecipients();
  if (addresses != null) {
    for (    Address address : addresses) {
      if (address instanceof InternetAddress) {
        recipients.add(new MailAddress((InternetAddress)address));
      }
    }
  }
  sendMail(sender,recipients,message);
}

@ Override public void sendMail ( MimeMessage message ) throws MessagingException { MailAddress sender = new MailAddress ( ( InternetAddress ) message . getFrom ( ) [ 0 ] ) ; Collection < MailAddress > recipients = new HashSet < MailAddress > ( ) ; Address addresses [ ] = message . getAllRecipients ( ) ; if ( addresses != null ) { for ( Address address : addresses ) { if ( address instanceof InternetAddress ) { recipients . add ( new MailAddress ( ( InternetAddress ) address ) ) ; } } } sendMail ( sender , recipients , message ) ; }
place a mail on the spool for processing
