1. Any person, firm or corporation and the employers, officers or agents thereof, whether the owner or lessee of the property leased, who or which has or hereafter shall have received from a tenant or licensee a sum of money or any other thing of value as a deposit or advance of rental as security for the full performance by such tenant or licensee of the terms of his lease or license agreement, or who or which has or shall have received the same from a former owner or lessee, shall, upon conveying such property or assigning his or its lease to another, or upon the judicial appointment and qualifying of a receiver in an action to foreclose a mortgage or other lien of record affecting the property leased, or upon the conveyance of such property to another person, firm or corporation by a referee in an action to foreclose a mortgage or other lien of record affecting the property leased if a receiver shall not have been appointed and qualified in such action, at the time of the delivery of the deed or instrument or assignment or within five days thereafter, or within five days after the receiver shall have qualified, deal with the security deposit as follows: Turn over to his or its grantee or assignee, or to the receiver in the foreclosure action, or to the purchaser at the foreclosure sale if a receiver shall not have been appointed and qualified the sum so deposited, and notify the tenant or licensee by registered or certified mail of such turning over and the name and address of such grantee, assignee, purchaser or receiver.