We analyze transmission characteristics and near-field patterns of metallic gratings at different polarizations. We not only study the resonance transmission, but also focus on the transmission mechanism at Rayleigh wavelength where the standing wave is excited by incident wave. For P-polarization (TM), the standing wave causes surface charge redistribution, which results in null transmission. However, for S-polarization (TE), the constructive interference between incident wave and standing wave leads to high transmission. The calculation results are in good agreement with experiments. We show that the metallic gratings can be designed as optical filters for different polarizations by tuning the resonance wavelength of Fabry-Perot mode.