public void sendMail (String to, String subject, String content) throws MessagingException {
        Properties props = new Properties();
        props.put("mail.smtp.user", emailConfig.getUser());
        props.put("mail.smtp.host", emailConfig.getHost());
        props.put("mail.smtp.port", emailConfig.getPort());
        props.put("mail.smtp.starttls.enable","true");
        props.put("mail.smtp.debug", emailConfig.getDebug());
        props.put("mail.smtp.auth", emailConfig.getAuth());
        props.put("mail.smtp.ssl.trust", emailConfig.host);

        String pass = emailConfig.getPass();

        SMTPAuthenticator auth = new SMTPAuthenticator(emailConfig.getUser(), pass);
        Session session = Session.getInstance(props, auth);

        MimeMessage message = new MimeMessage(session);

        message.setFrom(new InternetAddress(emailConfig.getUser()));
        message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));

        message.setSubject(subject);

        message.setContent(content, "text/html");

        // Send message
        Transport.send(message);
        if(logger.isInfoEnabled()) logger.info("An email has been sent to " + to + " with subject " + subject);
    }
@Test
    @Ignore
    public void testEmail() {
        EmailSender sender = new EmailSender();
        try {
            sender.sendMail("stevehu@gmail.com", "test", "This is a test email");
        } catch (MessagingException e) {
            e.printStackTrace();
        }
    }