No officer or agent of a city of the metropolitan class shall solicit, directly or indirectly, the political support of any contractor, municipal franchised corporation, or railway company, or the officials or agents of such companies, for any municipal election or for any other election held in the city. No franchised corporation or railway company, through its agents or officials or by any other means, shall furnish or appropriate any money, directly or indirectly, to promote the success or defeat of any person in any election held in such city or to promote or prevent the appointment or confirmation of any appointive officer of such city. A violation of any of this section on the part of any officer or agent of the city shall be deemed malfeasance in office, and upon conviction of such violation such officer shall be removed from office by the order of the court and fined in any sum not to exceed five hundred dollars. A violation of this section on the part of any franchised corporation through its officials or agents, upon conviction by any court of competent jurisdiction, shall subject such corporation to forfeiture of its franchise and the imposition of a fine of not exceeding five hundred dollars upon every officer or agent of such company who shall have been proved guilty of such violation.