Adam Britten, 26, of Rodney Road, Hartford, Cambridgeshire, admitted bringing a prohibited article into prison when he appeared at Mansfield Magistrates Court on Wednesday.
Neil Hollett, prosecuting, said Britten was detained by prison staff when they saw him pass an object to an inmate on May 21.
Police discovered the package contained 10 grammes of a substance which was described in a court as a cannaboid leaf, and is banned under the 1952 Prison Act.
Mary Dixon, mitigating, said: “Mr Britten accepts that he knew that this was contraband. He was taking it in for a person who he had served a sentence with previously.”
She said Britten, who now works as a train fitter, was released from the prison in October 2015 and was now working well with the probation service.
He was fined £250 and ordered to pay a £30 victim surcharge and £85 court costs.