A magnet unit is provided with a solenoid with a coil whose core is
attached in a recess on the front side of a base, with a movable anchor
activated by a recoil spring with a valve closing element and with a
protective cap attached on a shoulder of the base within which the anchor
and the solenoid are located, with a first end of the coil of the
solenoid being led to a connecting contact located on the other front
side of the base, the shoulder having, on its side facing away from the
base, a circumferential annular flange located inside the protective cap,
enclosing and protruding over the front surface of the shoulder and a
second end of the coil being attached on the front surface.