Strictly speaking you should write to the hosts (or whoever issued the invitation), using the same style as them. Eg, if formally worded in the third person, answer formally in third person. You only have to "regret you are unable to attend", you don't need to give a reason. However, since it is a close connection, you could write that you are really sorry to miss it, blah, blah. You can still/should send a gift with your congratulations and best wishes.