Dressing appropriately for the situation is part of having good manners.
During every wedding consultation I ask the potential clients what the dress code is for their wedding. They usually respond with a weird look. I explain to them that I try to blend in during the wedding and want to dress like a guest. This allows me to get better candids during their big day.
When it comes to how you should dress for a wedding the first thing to keep in mind is the formality of the wedding. Most weddings I go to the dress ranges from khakis and polo shirts to suits for the men. On occasion I’ve been to very informal weddings where dressing down was appropriate. It is important not to outdress the groom. Their wedding is all about them and not you. Also keep in mind the time of year. Browns and other earth tones are more fitting for fall whereas lighter colors are more appropriate for spring and summer. I usually wear dress pants, dress shoes, dress shirt, blazer, tie, and pocket square to most weddings I photograph. Black oxford or brown derbies are safe options shoe wise. Grey or khaki dress pants are a reliable choice. A navy blazer is a versatile standard. Staying with light blue or white dress shirts is always a safe bet. A white pocket square with a simple presidential fold is always classy. Sticking with simple classic ties instead of gimmicky novelty ties is good choice. Feel free to go crazy with socks as long as they aren’t white.
Dressing well doesn’t require a large budget but it can require patience. Most of the dress cloth I own come from eBay or second hand stores like Goodwill and Salvation Army. I would highly recommend Real Men Real Style and the Gentleman’s Gazette as resources for learning about classic men’s style.