  We study the effects of a finite mass for the photon on its propagation in a
weak gravitational field. In particular, we analyse the gravitational time
delay, also known as the Shapiro effect. We work in isotropic coordinates in
the weak-field limit and find that the mass-dependent corrections enhance the
gravitational time delay. Doppler-tracking data from the Cassini mission allow
us to set an upper bound on the photon mass, namely $m_\gamma < 4.9 \times
10^{-7} \, {\rm eV/c^2}$ at $95\%$ CL. We also discuss next-generation
solar-system tests of general relativity that could improve this upper limit,
potentially by a factor of ten. Though not competitive with the currently best
limits, our bound is at the ballpark of earlier ones based on the gravitational
bending of light by the Sun.
