There is only one way to feel content: You must learn to be satisfied with what you have and not always long for what is missing.
Attribution checked
Quothly found supporting evidence for this attribution.
A cited entry on the German Wikiquote page for Theodor Fontane records the sentence (from a letter to Emilie Fontane, 7) matching the wording in German, confirming his authorship/use.
Theodor Fontane – Wikiquote (Deutsch)