Clean the door gasket as suggested in previous answers but you need to perform 2 additional cleaning tasks. 1. Clean the detergent dispenser. Remove the dispenser from the washer and remove all black deposits. Let it dry. 2. Cleaning the door gasket and the dispenser will remove about 75% of the smell but not all. To remove all of the sources of mold the in the washer, the corrugated drain tube between the washer tub and the drain pump needs to be completely pumped dry. This tube is the perfect environment for mold since it is always wet, the soapy discharge water is a great food supply and it is dark. You will need a 6.5 HP wet/dry vac to evacuate the water out of the tube up through the discharge pump and hose. Close the washer door and reinstall the soap dispenser. Then attach the vac to the outlet of the discharge tube. This connection must be vacuum tight so some messing with different adapters might be required. Suck the washer water that remains in the washer into the wet vac. To obtain good vacuum can be difficult. Sometimes you will need to raise the drain tube as high as possible to initiate the flow of water out of the drain pump. You should expect to remove about 1qt. of soapy water. It will probably stink like mold also. Dump about 1qt. of vinegar into the bottom of the tub and let it set 1hr. Remove this with the wet vac. Repeat 2 more times. After the third time add 1qt. of vinegar and leave it. The next wash cycle will pump it out. Never leave the soapy drain water from the washer in the machine for more than 4 days, otherwise, the the stink will return. Cleaning the gasket, the soap dispenser and pumping out the soapy pump water will remove all sources of mold from you washer and your clothes will smell clean again.
I would put in some bleach and clothes that can handle it without damage and run a wash cycle. Leave the door open when you are done using the machine, or at least un-latched. There are commercial products, but bleach will do the same thing. You have stuff growing on the gizzards inside the drum, and bleach will likely kill them. They like dark & humid places.. guess what... that's your washer with the door kept latched.
Answers & Comments
Clean the door gasket as suggested in previous answers but you need to perform 2 additional cleaning tasks. 1. Clean the detergent dispenser. Remove the dispenser from the washer and remove all black deposits. Let it dry. 2. Cleaning the door gasket and the dispenser will remove about 75% of the smell but not all. To remove all of the sources of mold the in the washer, the corrugated drain tube between the washer tub and the drain pump needs to be completely pumped dry. This tube is the perfect environment for mold since it is always wet, the soapy discharge water is a great food supply and it is dark. You will need a 6.5 HP wet/dry vac to evacuate the water out of the tube up through the discharge pump and hose. Close the washer door and reinstall the soap dispenser. Then attach the vac to the outlet of the discharge tube. This connection must be vacuum tight so some messing with different adapters might be required. Suck the washer water that remains in the washer into the wet vac. To obtain good vacuum can be difficult. Sometimes you will need to raise the drain tube as high as possible to initiate the flow of water out of the drain pump. You should expect to remove about 1qt. of soapy water. It will probably stink like mold also. Dump about 1qt. of vinegar into the bottom of the tub and let it set 1hr. Remove this with the wet vac. Repeat 2 more times. After the third time add 1qt. of vinegar and leave it. The next wash cycle will pump it out. Never leave the soapy drain water from the washer in the machine for more than 4 days, otherwise, the the stink will return.
Cleaning the gasket, the soap dispenser and pumping out the soapy pump water will remove all sources of mold from you washer and your clothes will smell clean again.
I would put in some bleach and clothes that can handle it without damage and run a wash cycle. Leave the door open when you are done using the machine, or at least un-latched. There are commercial products, but bleach will do the same thing. You have stuff growing on the gizzards inside the drum, and bleach will likely kill them. They like dark & humid places.. guess what... that's your washer with the door kept latched.