If the problem file is in an email, save it to your hard drive before you try to open it. There may be a problem with the file extension. Unassociated file extensions are visible and editable in the file name, so you can easily see if it's simply wrong. For instance, if the filename ends with .jp, press F2 and change it to .jpg.
Otherwise, here's the easiest way to assign an association to an unassociated file in Windows XP or Vista:
1. Double-click the file.
2. In the resulting Windows dialog box, click Select the program from a list (in Vista, that's Select the program from a list of installed programs), then OK.
3. In the resulting Open With dialog box, select a program, check Always use the selected program to open this kind of file and click OK.