Acute illness with high fever will impair sperm production, usually temporarily. The effects are related mostly to the higher than normal temperature in the testicle. Recovery takes time, often over six months for the sperm counts to fully rebound.
Chronic illness also effects fertility. Sickle cell disease and hemachomoatosis affect the health of the testicles over time by degrading the circulation to the testicles. These are genetic conditions. Acquired diseases such as diabetes, renal disease, liver disease, and thyroid disease impair sperm production. The earlier these diseases are brought under control, the better. Some illnesses require medication with side effects that impair sperm production, such as sulfasalazine for ulcerative colitis and dilantin for seizure disorder. Switching from one medication to another may help improve sperm production over time.