So what specific iMac? Can you go to > About This Mac and tell us what it says there (or post a screenshot). There have been several iMacs and some of them have different video outputs so it's impossible to recommend you anything with so little info.
The same applies to the projector. Do you know what video inputs does it have? If you don't, can you look up its model number and post it here so we can take a look? Or take a picture of its back where the inputs are located.