code: public void sendMimeMail(String from, String replyTo, String[] to, String[] cc,
                               String[] bcc, String subject, String msg, Boolean html,
                               String attachmentFilename, File attachmentFile)
          throws MessagingException, MailException {
  
          Boolean multipart = false;
  
          // if a attachment file is required, we have to use a multipart massage
          if (attachmentFilename != null && attachmentFile != null) {
              multipart = true;
          }
  
          MimeMessage mimeMailMessage = mailSender.createMimeMessage();
          MimeMessageHelper mimeHelper = new MimeMessageHelper(mimeMailMessage,
              multipart);
  
          // fallback to default mail sender
          if (from == null || from.isEmpty()) {
              from = defaultMailSender;
          }
  
          // set minimal configuration
          mimeHelper.setFrom(from);
          mimeHelper.setTo(to);
          mimeHelper.setSubject(subject);
          mimeHelper.setText(msg, html);
  
          // add replyTo address if set
          if (replyTo != null && !replyTo.isEmpty()) {
              mimeHelper.setReplyTo(replyTo);
          }
  
          // add bcc address(es) if set
          if (bcc != null && bcc.length > 0) {
              mimeHelper.setBcc(bcc);
          }
  
          // add cc address(es) if set
          if (cc != null && cc.length > 0) {
              mimeHelper.setCc(cc);
          }
  
          // add attachment file if set
          if (attachmentFilename != null && attachmentFile != null) {
              mimeHelper.addAttachment(attachmentFilename, attachmentFile);
          }
  
          sendMail(mimeMailMessage);
      }
docs: Sends a MimeMessage.
  
  @param from               The mail sender address.
  @param replyTo            The reply to address.
  @param to                 A list of mail recipient addresses.
  @param cc                 A list of carbon copy mail recipient addresses.
  @param bcc                A list of blind carbon copy mail recipient addresses.
  @param subject            The mail subject.
  @param msg                The mail message text.
  @param html               Whether to apply content type "text/html" or the default
  content type ("text/plain").
  @param attachmentFilename The attachment file name.
  @param attachmentFile     The file resource to be applied to the mail.
  @throws MessagingException