A man who used drones to fly drugs, tobacco and phones into prisons has been jailed for nearly seven years.