Craig Fairley, 37, from Broxburn, West Lothian, was arrested and charged with drug dealing after being tracked by police.
At Livingston Sheriff Court yesterday he pleaded guilty to being concerned in the supply of cannabis. The court was told he posted two separate packages containing the Class B drug four months apart.
The first, on May 23 last year, was addressed to Addiewell prison in West Lothian. The second, mailed on September 5, went to Saughton Prison in Edinburgh.
Paul Beaton, prosecuting said: “The two postal packages were sent from Broxburn Post Office.” Iain Smith, defending, said Fairley had previous convictions but had stayed out of trouble for 11 years.
He said: “He obviously is aware of the possibility of a prison sentence.”
Sheriff Grahame Fleming called for criminal justice social work reports and deferred sentence.