A dealer who "advertised" drugs for sale in text messages has been spared jail.
Police found the exposing chats on Jonathan Finn's phone after it was seized when he was arrested in Sunderland in March.
Prosecutor Peter Schofield told Newcastle Crown Court the 23-year-old was carrying cannabis worth up to £250 when he was picked up by the officers, who had noticed the cannabis smell when they stopped him in his van.
Mr Schofield added: "The texts, all in early March, contained advertisements, in effect, putting out he had cannabis for sale.
"There were questions about credit from individual purchasers and there were inquiries generally about the availability of drugs."
Finn, of Low Station Road, East Rainton, who was on a suspended sentence for criminal damage at the time, admitted he had been dealing after he was confronted with the text messages.
He pleaded guilty to possessing a class B drug with intent to supply, driving with no insurance and no licence.
Judge Sarah Mallett sentenced him to 8 months imprisonment, suspended for two years, with a ten month curfew, 150 hours unpaid work and rehabilitation requirements.
The judge told him: "I am giving you a very last chance."
Vic Laffey, defending, said Finn had got into debt to a dealer through his own cannabis habit and was put under pressure to sell so he could pay it off.
Mr Laffey said Finn now has an offer of a job, has sought professional help, no longer uses cannabis and his life is "back on track".