code: private void close() {
          if (transport != null) {
              if (transport.isConnected()) {
                  try {
                      transport.close();
                      logger.debug("邮件客户端关闭完成");
                  } catch (MessagingException e) {
                      logger.debug("关闭邮件客户端时发生异常", e);
                  }
              }
          }
  
      }
docs: 关闭客户端连接