public static function quoted_printable($string, $maxlen = 76) {
			// Make sure the string contains only Unix line breaks
		$string = str_replace(CRLF, LF, $string); // Replace Windows breaks (\r\n)
		$string = str_replace(CR, LF, $string); // Replace Mac breaks (\r)

		$linebreak = LF; // Default line break for Unix systems.
		if (TYPO3_OS == 'WIN') {
			$linebreak = CRLF; // Line break for Windows. This is needed because PHP on Windows systems send mails via SMTP instead of using sendmail, and thus the line break needs to be \r\n.
		}

		$newString = '';
		$theLines = explode(LF, $string); // Split lines
		foreach ($theLines as $val) {
			$newVal = '';
			$theValLen = strlen($val);
			$len = 0;
			for ($index = 0; $index < $theValLen; $index++) { // Walk through each character of this line
				$char = substr($val, $index, 1);
				$ordVal = ord($char);
				if ($len > ($maxlen - 4) || ($len > ($maxlen - 14) && $ordVal == 32)) {
					$newVal .= '=' . $linebreak; // Add a line break
					$len = 0; // Reset the length counter
				}
				if (($ordVal >= 33 && $ordVal <= 60) || ($ordVal >= 62 && $ordVal <= 126) || $ordVal == 9 || $ordVal == 32) {
					$newVal .= $char; // This character is ok, add it to the message
					$len++;
				} else {
					$newVal .= sprintf('=%02X', $ordVal); // Special character, needs to be encoded
					$len += 3;
				}
			}
			$newVal = preg_replace('/' . chr(32) . '$/', '=20', $newVal); // Replaces a possible SPACE-character at the end of a line
			$newVal = preg_replace('/' . TAB . '$/', '=09', $newVal); // Replaces a possible TAB-character at the end of a line
			$newString .= $newVal . $linebreak;
		}
		return preg_replace('/' . $linebreak . '$/', '', $newString); // Remove last newline
	}