The 49-year-old will have to perform 100 hours of unpaid work as part of the order after he pleaded guilty at an earlier hearing to sending unwanted text messages - up to 10 a day - and emails to beautician Sarah Kinder.
Hendry had also admitted making unwanted visits to her home in Lytham St Annes, Lancashire, and twice threw stones at her bedroom window to get her attention.
The harassment began when Miss Kinder broke off their relationship in March and continued until April 18 when the ex-Blackburn Rovers defender was arrested by police on suspicion of assaulting her.
Hendry denied common assault and the Crown dropped that allegation against him earlier this month when Miss Kinder retracted her police statement.
Sentencing him at Blackpool Magistrates’ Court yesterday, Deputy District Judge Alan Lloyd Jones pointed out that none of the communications were threatening or abusive as he said the case was “not so serious” to impose a custodial sentence. Hendry began seeing Miss Kinder following the death of his wife Denise, 42, in 2009 from botched cosmetic surgery.
Paul Schofield, representing Hendry, told the judge: “This year has been extremely difficult for him. You know about the family tragedy.
“In 2009 Mr Hendry’s wife sadly passed away and Mr Hendry was left with four dependent children between the ages of 10 and 20.
“He has had a great deal to contend with as far as all that aspect with his life is concerned. He is determined that this case marks the end of what can be classed as a blip for him, in the last six months in total, and he can assure you - through me - that he will never transgress in any way again.”
Hendry, of Lytham St Annes, was also ordered to pay £410 in court costs and charges.
Earlier this year, he received a 17-month road ban after he admitted drink-driving in his home town in the early hours.
Hendry enjoyed a long and successful playing career as a central defender and captained his country in the 1998 World Cup.
He played for a number of clubs including Blackburn Rovers, where he won a Premier League title, Manchester City, Bolton Wanderers and Rangers.
Miss Kinder finished the relationship in late December 2014 before the couple resumed their relationship in February this year, the court heard.
Prosecutor Alison Quanbrough said Hendry took the final March break-up “quite badly” and was said to be “in emotional turmoil” as he could not understand why the relationship had ended.
She said that Miss Kinder had not wished to give evidence against him, did not want a restraining order and “simply wanted to put the matter behind her”.
She added that Miss Kinder did not “necessarily think” it was harassment but it had caused her “upset and distress” and had a knock-on effect with her children and Hendry’s children.
The content of the messages was not hostile and was “almost affectionate” but the frequency of the contact amounted to harassment, the court heard.
The court heard that Hendry was currently unemployed but his solicitor said that “hopefully that will change in the near future”.