Many times the smell comes from a broken down annode rod in the water heater. The annode rod is a rod that absorbs the damage to water heaters caused by iron and other chemical reactions. Since the rod is made of a soft material, it breaks down first. Once it looses its ability to disintegrate, (because of significant material loss or stabilization) the iron and other chemicals begin to affect the water heater itself. Many times the resultant odor is rotten eggs. Check it out.