Alternately, use a short piece of any flexible, thin wire you can buy in a roll at any DIY store... attach one end to any convenient screw or hole in the body of the dryer and the other end to the nearby water feed to your washer (alternately, slightly unscrew one of the plastic cover screws from the electrical plate cover and take a turn or two around the screw and retighten). This will, in effect, ground your dryer to eliminate the high voltage/low amperage static electricity build up.
This usually will not occur if the electricity feed to the dryer had an internal ground wire... some older homes don't... at least here in the U.S. The dryer sheet idea is a good one too... except a lot of people don't like them for the scent left behind, although I think there are unscented ones...