correction: See below.
correction: See below.
Sorry, this is completely false. Light is affected by gravity because gravity is really a curvature of spacetime.
* I guess "curvature of spacetime" is perhaps not the most satisfying explanation of why light is redshifted as it moves out of a gravitational potential well (i.e. if you shoot a laser from earth into space). Nonetheless the answer is still "because of relativity".
The actual equation is E^2 = (mc^2)^2 + (pc)^2, where the p is momentum. And, unsurprisingly, the old "p=mv" isn't the whole story, either. The (magnitude of the) momentum of a photon is given by h/λ where h is Planck's constant and λ, of course, is the wavelength.
As such, at no point is it necessary for light to have mass and it is believed that, in fact, photons are entirely and truly massless. Relativistic mass--which some take to mean photons actually gain mass--is a confusing and misleading concept that doesn't really have a whole lot to do with actual mass and doesn't really help explain anything.
"Effective mass"--which is more related to stopping photons, but not really related to the Einstein equation you gave--also doesn't really mean the photon gains mass but it does mean that interactions within the crystal give effects similar to if the photon had mass.
In general relativity, space-time curvature is the gravitational field, so I'm not quite sure what distinction you're trying to draw?