Constipation can be caused by many things including medication, certain disease states, and diet. The most important thing is to try and determine the cause.
In regard to treatment, Epsom salts are not a recommended medication for most individuals as there are safer and more effective products available.
Additionally, most Epsom salt products are not labeled for internal use.
First off, in your diet, you want to try to increase dietary fiber to a total of about 20 to 25 grams per day.
This can be from either supplementation (psyllium fiber, for example, can be found as a powder in health stores) or from fiber-rich foods such as wheat, whole grains, and vegetables. Increasing fiber, unfortunately, is not a quick fix for constipation. You may need to try over the counter products as well.
One of the best and well tolerated over the counter laxatives is known as Miralax, or PEG 3350. It is a dry powder you mix with liquid. As mentioned previously, it is well tolerated, but sometimes can cause some bloating. It works by increasing the amount of water in the stool and makes it easier to pass. Make sure to drink water!
Stimulant laxatives, such as bisacodyl also work well and may work a little faster than Miralax. They do tend to cause diarrhea in some patients, however.
Stool softeners such as Colace and docusate help reduce straining but aren't a good choice if you are actually constipated. They don't really get the bowels moving, just if the stool is hard to pass.
If these don't work, one of the most effective products is called Milk Of Magnesia. It tends to cause diarrhea and watery stools but works quickly.
Epsom Salts For Constipation
Epsom salt has been used and is usually effective for short term use in treating constipation.
However, the vast majority of products you will find on the shelves of stores are NOT for internal use because they don't meet purity standards as they are only intended for external use. So be sure to be careful when selecting a product. Also, Epsom salt should not be used in those with any kidney problems.
If you do find a product intended for oral use, the usual dosage for adults is 10-30 grams in either a single dose or divided doses. 
This usually translated to around 2-5 teaspoonfuls. You want to dissolve the powder/crystals in a full glass of water and drink on an empty stomach. It is important to follow this with a full glass of water to avoid dehydration. Ingesting Epsom salt draws water into the bowels and can cause a good amount of fluid loss.