John Wallace, of Nethy Bridge, threw cardboard boxes containing the contraband over the prison's walls and picked them up when he was on duty.
Inverness Sheriff Court heard that the 36-year-old agreed to do this over a five month period to help him pay off family debts.
Sheriff Gordon Fleetwood sentenced Wallace to 40 months in prison.
The sheriff told Wallace: "This was a gross breach of trust and both those in prison and your employers should have been able to rely on your integrity.
"But I will take into account the difficulties you will face in prison.
"I consider five years as appropriate but I will reduce this by a third to one of three years and four months to take into account your early plea."
The sentence was backdated to 10 February.
Wallace had earlier admitted two charges that between 27 October 2015 and 18 March 2016 he introduced, without reasonable excuse, to HMP Porterfield mobile phones and cannabis resin.
He also pleaded guilty to being concerned in the supply of cannabis resin in the prison and elsewhere whilst acting with others.
Wallace was caught following a Police Scotland investigation targeting those involved in the supply of controlled drugs into Inverness Prison.
Det Insp Peter Mackenzie said: "This case is an example of our commitment to tackle the supply of controlled drugs into the Her Majesty's Prison whilst working together with the Scottish Prison Service.
"Our message to individuals involved in the supply of controlled drugs into Her Majesty's Prison is that we will continue to pro-actively target those involved whilst working together with our partner agencies to identify emerging trends and methods utilised by the individuals involved."
A former prison officer has been jailed after admitting to smuggling drugs and mobile phones into Inverness prison.