private static function decodeContent($content, $encoding) {
    switch (strtolower($encoding)) {
      case 'base64':
        return base64_decode($content);
      case 'quoted-printable':
        return quoted_printable_decode($content);
      default:
        return $content;
    }
  }