Take the detergent tray out and drop it in a bucket of boiling water and bleach, it's a hive of mould in most machines. Then clean the area where the tray fits, all the way to the back paying attention to the part above the tray (you may need a torch to see).
Also, the front seal/gasket collects lint and then builds up mould, so you have to pull that back and use a cloth to scoop that area out and then bleach with hot water there as well. Because the door fits so tightly, that is one of the worst places for the smellies to accumulate.
After a wash, leave the door open, do not close it, even if inconvenient. Close it when you are sure it's dry inside.
Because we do not regularly tend to use a hot wash cycle, mould grows behind the drum as well because of the low temp washing products.
Speaking from experience... we let several flats with washers and the young folk also tend to start a wash then go off to work, so it sits in there all day as well and their clothes then smell compounding the problem with the mouldy detergent tray.
We try to encourage them to start the wash when they come home from work, then take it out before bed and leave the door open. Even if you don't get a chance to put it on the airing rack...take it out and put in a laundry basket so the clothes can breathe fresh air!
Good luck!