340. Notwithstanding any agreement to the contrary, the insurance agent is the mandatary of the insurer when he collects premiums from the insured and when he receives amounts from the insurer intended for the insured or beneficiaries of the insured.