Electric Water Heater Venting

I bought a house that had two water heaters. One was an electric water heater located in a closet. What is the requirement for venting an electric water heater? I’ve already removed both water heaters and replaced them with one large one located outside, but I was curious about this as there was no vent for the electric water heater located in the closet. It was just venting into the closet and adjoining rooms. The adjacent rooms were musty and you could feel the moisture in the air and see condensation on the windows every day. The bathroom next to the water heater was covered in black mold. As I mentioned, I moved the water heater already and remodeled the adjoining rooms, but I was always curious about that. My plumber doubted if it was to code, but he didn’t say, and at the time I didn’t really care since we were removing it anyways. The house inspector never wrote or made mention of it when we bought it.
Replies
The only reason an electric hot water heater needs a "vent" is for overpressure/high temperature. And this vent is for the water. 99.99999% of the time, the electric hw heater is part of a closed system. Around here, they are sometimes built into cabinets (in our office, it's part of the kitchen cabinetry, and you need a screwdrive to get at it).
For what reason would you think a vent is required? Also, when you say you installed a new hw heater "outside", outside where? As in outdoors? What climate are you in?
As I recall, there was an opening at the top of the hot water heater and steam would come out of it. It did not appear to be 'closed.' Maybe someone removed something at the top and didn't replace it?
We replaced the two wh with a single gas heater outside, as in outside the house in a small enclosure. We are in Socal, in mild climate.
On the top of the hw heater shoudl be a tp valve; it's a temperature/pressure relief valve, and will only go off if there is a problem (ie, overtemperature or overpressure). Logically, you pipe this down to a floor drain of some sort in case of problems.
If you had ANY open holes on the top of the hw heater, something was seriously amiss. It should be pressurized to the same pressure as the rest of the water lines in the house. It sounds like maybe you had a faulty tp valve that was constantly weeping or blowing off; that certainly would be a mess.