Here are your parts
Replacement parts for Maytag MED5870TW0 29" ELECTRIC DRYER | AppliancePartsPros.com
See the attachment for the wiring diagram
You said "The timer works".
If by this you mean that the timer advances when in a timed dry mode then the door switch is OK.
There seems to be a disagreement between the wiring diagram and the parts breakdown.
The wiring diagram shows a thermal fuse in the motor circuit but I cannot find it in the parts.
If it has one then it will be mounted on the blower.
It will be like the following.
Part number: AP3132867
Click on the picture for more info.
I would check for this first.
If it has one and it is blown then be sure to check/clean your vent system as this is the most common cause of it blowing.