private static function encodeAttachment($boundary, FsPath $path, $fileName, $charset, $encoding, $eol = "\n") {
		$file = new FsPath($fileName);
		$string = "--{$boundary}{$eol}"
			. "Content-Type: " . self::getMimeType($file->getExtension()) . "; name=\"" . mb_encode_mimeheader($file->getName(), $charset, 'Q', $eol) . "\"" . $eol
			. "Content-Disposition: attachment; filename=\"" . mb_encode_mimeheader($file->getName(), $charset, 'Q', $eol) . "\"" . $eol
			. "Content-Transfer-Encoding: " . self::ENCODING_BASE64 . $eol . $eol;
		$string .= self::encodeString(IoUtils::getContents($path), 'base64', $eol);
		return $string;
	}