iMac keeps turning itself off - won't come back on again
Using my MacBook I went online and, following some advice I found there, reset the SMU. That seemed to work - the iMac started up again. But then twenty minutes later it 'died' for a second time. I left it for the afternoon, periodically seeing if I could turn it on using the power button. I couldn't. After about five hours I got it to start up again with no problems, long enough to run the Hardware Test. It found no problems. I restarted the computer - started up fine again. Then five minutes or so later died for a third time.
Following a suggestion in the manual, this morning I have reset the NVRAM. Once again, the iMac started up fine but died shortly afterwards.
Please, does anyone have any ideas? I haven't recently installed any new software or anything like that and I wasn't doing anything unusual when the problem first manifested. The cable is obviously OK, the wall sockets are fine. What else could it be?
iMac, Mac OS X (10.5.5)