When building a wood fence, you need to decide weather to go with pressure treated or untreated lumber.
Pressure Treated Pressure treated lumber is goes through a chemical process which preserves the lumber to protect it from insects, fungus and decay. Pressure treated wood tends to be a less expensive option for fences as oppose to choosing a wood species that is naturally resistant to outdoor elements. Pressure treated lumber is generally pine or fir.
Untreated Western Red Cedar and Southern Cypress are two examples of untreated wood that are naturally resistant to insects and moisture damage. This is a more expensive option, but should be considered if you plan to plant a garden along the fence.