Sneezing can further be triggered through sudden exposure to bright light, a particularly full stomach, or as a result of unexpected, climatic variations in
one's environment such as rapid changes in
temperature and humidity levels.
Therefore, a sneeze may trigger the outflow of trapped mucous material in the nasal cavity as well as substances from the respiratory or pharyngeal areas. This may be responsible for the bad smell.
Hope this answered your query.