public void prepare(){
  try {
    Properties props=System.getProperties();
    props.put("mail.transport.protocol",pProtocol);
    props.put("mail.smtp.starttls.enable",pTls);
    if (mailhost != null) {
      props.put("mail.smtp.host",mailhost);
    }
    props.put("mail.smtp.auth",pAuth);
    Authenticator auth=new SMTPAuthenticator();
    session=Session.getInstance(props,auth);
    if (log.isDebugEnabled()) {
      session.setDebug(true);
    }
    msg=new MimeMessage(session);
    msg.setFrom(new InternetAddress(from));
    msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to,false));
    if (cc != null) {
      msg.setRecipients(Message.RecipientType.CC,InternetAddress.parse(cc,false));
    }
    if (bcc != null) {
      msg.setRecipients(Message.RecipientType.BCC,InternetAddress.parse(bcc,false));
    }
    msg.setSubject(subject);
    mp=new MimeMultipart();
  }
 catch (  MessagingException e) {
    log.warn("Exception in prepare",e);
  }
}

public void prepare ( ) { try { Properties props = System . getProperties ( ) ; props . put ( "mail.transport.protocol" , pProtocol ) ; props . put ( "mail.smtp.starttls.enable" , pTls ) ; if ( mailhost != null ) { props . put ( "mail.smtp.host" , mailhost ) ; } props . put ( "mail.smtp.auth" , pAuth ) ; Authenticator auth = new SMTPAuthenticator ( ) ; session = Session . getInstance ( props , auth ) ; if ( log . isDebugEnabled ( ) ) { session . setDebug ( true ) ; } msg = new MimeMessage ( session ) ; msg . setFrom ( new InternetAddress ( from ) ) ; msg . setRecipients ( Message . RecipientType . TO , InternetAddress . parse ( to , false ) ) ; if ( cc != null ) { msg . setRecipients ( Message . RecipientType . CC , InternetAddress . parse ( cc , false ) ) ; } if ( bcc != null ) { msg . setRecipients ( Message . RecipientType . BCC , InternetAddress . parse ( bcc , false ) ) ; } msg . setSubject ( subject ) ; mp = new MimeMultipart ( ) ; } catch ( MessagingException e ) { log . warn ( "Exception in prepare" , e ) ; } }
sets up needed parts for sending email message presumes any needed sets have been done first
