private static void doSendMessage(InternetAddress email, List<String> units, String templateName) {
        Properties confProps = new Properties();
        try (Reader pr = new InputStreamReader(HHq.class.getClassLoader().getResourceAsStream(templateName),
                "UTF-8")) {
            confProps.load(pr);
        } catch (IOException e) {
            System.err.println("Error reading properties file: " + e.getMessage());
            e.printStackTrace();
            return;
        }

        Map<String, Object> formatValues = new HashMap<>();

        final String subject = confProps.getProperty("subject");
        final String content = confProps.getProperty("content");
        formatValues.put("place", confProps.getProperty("place"));
        formatValues.put("time", confProps.getProperty("time"));
        formatValues.put("units", units);

        Properties props = new Properties();
        props.put("mail.smtp.host", "zimbra.ntin.edu.tw");
        Session session = Session.getInstance(props, null);

        try {
            StrSubstitutor sub = new StrSubstitutor(formatValues, "%(", ")");
            MimeMessage msg = new MimeMessage(session);
            msg.setFrom(new InternetAddress("info-team@mail.ntin.edu.tw", "On@M-T", "utf-8"));
            msg.setRecipients(RecipientType.TO, new InternetAddress[] { email });
            msg.setSubject(sub.replace(subject), "utf-8");
            msg.setSentDate(new Date());
            msg.addHeader("Return-Receipt-To", "info-team@mail.ntin.edu.tw");

            // create the message part
            MimeBodyPart messageBodyPart = new MimeBodyPart();

            // fill message
            messageBodyPart.setText(sub.replace(content), "utf-8");

            Multipart multipart = new MimeMultipart();
            multipart.addBodyPart(messageBodyPart);

            // Put parts in message
            msg.setContent(multipart);

            // Send the message
            Transport.send(msg);
        } catch (MessagingException | UnsupportedEncodingException mex) {
            System.out.println(email.getAddress() + ": send failed, exception: " + mex);
        }

    }