public function getMimeType($attachment) {
    $attachment = explode('.', basename($attachment));
    if (!isset($this->mimeTypes[strtolower($attachment[count($attachment) - 1])])) {
      pines_error('MIME Type not found.');
      return null;
    }
    return $this->mimeTypes[strtolower($attachment[count($attachment) - 1])];
  }