apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/defaultimpl/DefaultEmailService.java/DefaultEmailService/send
class DefaultEmailService:  @Override
  public void send(Email email) {
    if (!portalConfig.isEmailEnabled()) {
      return;
    }

    SMTPTransport t = null;
    try {
      Properties prop = System.getProperties();
      Session session = Session.getInstance(prop, null);

      Message msg = new MimeMessage(session);
      msg.setFrom(new InternetAddress(email.getSenderEmailAddress()));
      msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(email.getRecipientsString(), false));
      msg.setSubject(email.getSubject());
      msg.setDataHandler(new DataHandler(new HTMLDataSource(email.getBody())));

      String host = portalConfig.emailConfigHost();
      String user = portalConfig.emailConfigUser();
      String password = portalConfig.emailConfigPassword();

      t = (SMTPTransport) session.getTransport("smtp");
      t.connect(host, user, password);
      msg.saveChanges();
      t.sendMessage(msg, msg.getAllRecipients());
      logger.debug("email response: {}", t.getLastServerResponse());
    } catch (Exception e) {
      logger.error("send email failed.", e);
      Tracer.logError("send email failed.", e);
    } finally {
      if (t != null) {
        try {
          t.close();
        } catch (Exception e) {
          // nothing
        }
      }
    }
  }