Any officer or employee other than the mayor and councilmen (or commissioners) of any such city who shall solicit or attempt to influence any person to vote for any particular candidate at any election held in such city, or who shall in any manner contribute any money, labor or other valuable thing to any person or organization for election purposes, shall be guilty of a misdemeanor and, upon conviction, shall be punished by a fine not exceeding one hundred dollars, or by imprisonment in the county jail not exceeding thirty days, or by both such fine and imprisonment.