If invited to a marriage ceremony or a wedding celebration, you should accept the invitation unless it includes prohibited acts. Attending a wedding is part of noble sunnah of Rasulullah [Sallallahu álayhi wa sallam]. Islam regards marriage as an act of worship and obedience to Allah. For this, the jurists have mentioned that, it is preferable (mustahab) to contract the marriage in the masjid.
This is based on a hadith reported by Imam Tirmidhi and Imam Ibn Majah [Rahimahumullah]:
“Publicise the marriage, execute it in the masjid and celebrate it with the duff.”
Another hadith by Imam Ahmad and Al-Hakim and others supports the first part of the hadith:
“Publicise the marriage.”
It is also supported by a third hadith reported by Imams Ahmad, At-Tirmidhi, An-Nasái and Ibn Majah [Rahimahumullah]:
“The difference between a legitimate(halal) marriage and illegitimate (haram) relationship is the presence of voices and the duff.”
There is no dispute among Muslim scholars that in a wedding celebration, Rasulullah [Sallallahu álayhi wa sallam] allowed women to use the duff. The most valid opinion among scholars is that men can also use the duff in order to publicise the marriage, thus making it known far and wide.  The noble Islamic purpose of such publicity is to distinguish between an evil and illicit relationship and an Islamic, pure and halal marriage.
The hadith mentioned above: “The difference between a legitimate(halal) marriage and illegitimate (haram) relationship is the presence of voices and the duff,” is explained by our ulema as follows:
By ‘voice’ is meant that the nikah should be announced and mentioned to the people. Voice also refers to the singing of legitimate anáshíd (Islamic songs).
Attending a wedding is one of the rights of brotherhood among Muslims. It fulfils the requirement of publicity and it reinforces the testimony of marriage. It also gives you a chance to join your brethren in this pious act by which they complete half of Islam, which leaves only the second half for them to uphold. Attending a wedding also honours the husband and wife by having the relatives, friends and other pious people to share in their happiness. It blesses them with guests who pray to Allah for their righteousness, success, affluence and prosperity.
 Take note that the actual purpose of the duff was to publicise the marriage and not mere entertainment.