If your washer gets a bit whiffy , they do sometimes if stale water lies in the drum , between washes , add a few drops of lavender , eucalyptus or even tea tree oil ,into the drum and soap drawer this will keep the drum and drawer fresh untill your next wash .
I had this problem for a while, but solved it permenantly up to now by putting neat bleach in the little draw you normally put your powder in and putting the washer on the hottest cycle possible, 90 deg I think it was on mine. No more smell since and this was months ago, I did try it on a lower temperature but the smell came back after a few weeks, but the ultra hot wash plus the bleach did the trick
If you use a liquid washing powder in your washing machine change to a powder such as Ariel(the one in the green box.) Liquid powder, when used over a long period will make your washing machine smell nasty.The bleach in Ariel will freshen the machine and it also contains an anti-limescale ingredient too!
This tip was given by a washing machine engineer and it really works!
This really works as I was surprised as it does more than take care of mildew. Where you add your powder in the despencer get a full bottle of white vinegar and pour the bottle in. Put the washing machine on a cycle with no clothes inside and you will have a brillant result as it also breaks down limescale.
We used washing liquid at a low temperature until a few weeks ago when our machine leaked! Apparently its ok to use liquid and low temps but you should do a hot wash using powder periodically to wash out the bugs and bacteria and gunge which form in warm, damp conditions (ie in a washing machine). Since having machine fixed we've gone back to powder and doing a 40 degree wash. Result, no smelly, gungy machine.