Time to replace the anode
Many water heaters (particularly those that use a glass-lined steel tank) exhibit a suphur (rotten egg) smell when the anode has corroded away and requires replacing. The anode should be checked annually, during spring commissioning, and replaced if less than 50% of the original metal remains. It is a magnesium rod that is usually part of the hot water "out" nipple that comes with the water heater. Inside this nipple is a plastic coupling and a magnesium rod that extands all the way across the inside of the tank. The magnesium rod has an iron core, about 3/16" in diameter. When the magnesium has corroded away to where the iron core is exposed to the water, viola! the sulphur smell starts up. Changing the anode, then flushing out the water heater several times should get rid of the odor - if it is coming from the water heater. (be sure the electric power is off to the water heater before tinkering with it, or you'll burn out the electric heating element if it isn't covered with water inside the tank).Hopefully your water heater isn't one of the low end inexpensive models that doesn't have an anode, but has an anodized aluminum inner tank. When the anodizing wears away, the only cure is a new water heater.