The engine starts well but stop when it get too hot, even if the fan is running.
What is the main heating sensor the could cause the engine to stop. on 2005 Mazda Mazda3
The Engine Coolant Temperature (ECT) Sensor is used for proper operation of the engine. I know you don't want to hear this since I replied to you earlier but I don't think this is your problem. I may be wrong but usually a bad ECT will cause the car not to start but not die. The computer would just use the last know ECT received after losing the signal. This would allow the vehicle to run either ok or sluggish but not die.
1 more answer
In extreme heat, high humidity, or vigorous exertion under the sun, the body may not be able to dissipate the heat http://www.lightdeal.co.uk/