Why is it that we can feel the heat of the sun through glass?

However, if a piece of glass were separating me and a plug-in heater, I could not feel the heat from the heater?