Vectors like mosquitoes and ticks sometimes carry viruses and bacteria that can cause encephalitis. People who are bitten by infected mosquitoes develop the disease within a few days or up to two weeks after the bite.