For gas dryers you have to vent to the exterior due to the carbon monoxide that is vented out from the machine through the exhaust. Most local codes will also require you to vent gas dryers to the outside. I had a window by my dryer replaced with glass block and a vent to provide a way to vent to the exterior.