Snakes have an organ called "Jacobson's organ," which they use, in addition to their tongue, as a smell receptor. They are repulsed by strong odors and will leave the area if a strong odor is detected. In addition to using a snake repellent, keep grass cut short and clean up any junk piles that may provide a place for snakes to hide.
Moth balls work as snake repellents, but they are toxic to people and domestic animals.
Products such as Liquid Fence Snake Repellent provide an environmentally friendly solution that is safe and effective (see link in Resources).
Essential oil, such as cinnamon oil, is ideal for repelling snakes from small areas, such as a garage or crawl space. Saturate a sheet or towel in the oil and place it in the area.
A thin layer is an effective repellent because the small granules become embedded in the snake's scales.
Sulphur can be purchased at farm supply stores. Simply sprinkle it around the fence line or the foundation of your house or barn. Sulphur is not recommended if you have pets or small children.
Cats patrol the yard and work to control the mice population. Since mice are the main attraction for snakes, they will not come to the area if no mice are present.