Pneumonia can be transmitted through droplet infection, which occurs when bacteria or viruses travel on relatively large respiratory droplets when people sneeze, cough, or laugh, or through indirect contact, which occurs through exposure to contaminated objects or through inhalation of caustic or toxic chemicals.