Michael Leonard, Brookmount Lodge, Omagh, appeared at Enniskillen Magistrates Court today (Monday) via videolink from Maghaberry Prison.
The court heard that his actions on February 3 this year were most likely as a result of his "serious addiction to prescribed medication, primarily diazepam".
Police were tasked to Maguiresbridge Post Office that day following a report from the postmistress that £10 to £15 had been stolen from the NSPCC Charity Box.
A statement of complaint was made by the postmistress.
She gave a description of the culprit.
Officers detected the defendant outside, clearly matching the description of the male responsible.
He was identified, arrested and brought to Enniskillen Police Station.
He initially denied all knowledge of the offence, but a positive identification was later carried out.
Defence solicitor Michael Fahy conceded this was a particularly "nasty" offence.
"Charities of that nature depend very heavily on public donations and in that regard it was nasty," he said.
Mr Fahy said his client had been re-offending on an "annual basis" since he first came to the court's attention.
But, now in a relationship and with his girlfriend due to give birth, he said things were taking a turn for the better for Leonard.
"He has been weaning off the drugs and within a two to three week window he expects to be totally free of his addiction," Mr Fahy told the court.
The defence solicitor said the addiction had been "very live for most of the entries on his record".
But he was now a young man trying to deal with those issues.
District Judge Peter King said his actions on the day were not only nasty but "mean and despicable".
"I suspect you didn't take the box hoping there would be as little as £15 in there -- you probably hoped there would be a considerable bit more."
He sentenced Leonard to two months imprisonment.