Updated for versions 2.26 and 3.01:
Additional features:
- the script also works for orthographic and spherical cameras (for cylindrical cameras it's not possible to correctly map the texture).
- You can camera map the environment texture by selecting the texture environment node (although it will look weird if you have reflections of the environment in your scene).
Note that
--
Roeland