Whenever, under any law of this State or under any rule, regulation, order or requirement made pursuant to law, an oath is required to be taken by a person appointed to discharge specific duties in a particular action, proceeding or matter, whether or not pending in court, including but not limited to a person appointed as executor, administrator, guardian, conservator, appraiser, receiver, or elisor, an unsworn written affirmation may be made and executed, in lieu of such oath. Such affirmation shall commence “I solemnly affirm,” shall state the substance of the other matter required by the oath, the date and place of execution and shall be subscribed by him.