Nugatory said:
You are wrong. E=mc^2 only applies to objects with non-zero rest mass and photons have a zero rest mass. The equation that you're looking for is [itex]E^2=(mc^2)^2 + (pc)^2[/itex] where p is the momentum and m is the rest mass; this one works even if the rest mass is zero, as it is for a photon.
even though it is deprecated in most, nearly all, current texts, there is most certainly a usage to the famous [itex]E=mc^2[/itex] where the [itex]m[/itex] refers to the (oft deprecated) "relativistic mass":
[tex]m = \frac{m_0}{\sqrt{1 - \frac{v^2}{c^2}}}[/tex]
and [itex]m_0[/itex] is the "rest mass" or "invariant mass" of the body. a photon is assumed to move at a speed of [itex]c[/itex] in anyone's frame of reference, so it cannot have a non-zero rest mass because
[tex]m_0 = m \sqrt{1 - \frac{v^2}{c^2}}[/tex]
and the latter factor goes to zero when [itex]v=c[/itex].
if [itex]m[/itex] used in [itex]E=mc^2[/itex] is the expression above, then [itex]E=mc^2[/itex] is perfectly consistent with
[tex]E^2=(m_0 c^2)^2 + (p c)^2[/tex]
and
[tex]p = m v[/tex] .
this [itex]E[/itex] is the
total energy, the "rest energy" [itex]E_0=m_0 c^2[/itex] (which is the "E=mc^2" you're referring to) plus the kinetic energy (from the POV of the observer in the frame of reference).
[tex]E = m c^2 = E_0 + T[/tex]
the kinetic energy
[tex]T = E - E_0[/tex]
goes to the classical approximation [itex]T = \frac{1}{2}m_0 v^2[/itex] when [itex]v<<c[/itex].
This equation allows the photon to carry momentum, which is transferred to the sail when the photon hits it.
a quantity of the dimension "mass" can be derived from dividing the momentum of the photon by its speed (which is c).
"wrong" and "currently deprecated" are not the same thing.