Dean Andrews, 29, was arrested after the girl showed the messages to her mother, who contacted police.
Officers analysing Andrews' mobile phones found more than 200 child abuse images and videos.
Andrews was also placed on the sex offenders register for 10 years after being sentenced at Dundee Sheriff Court.
The court was told that Andrews, who has previous convictions for sexual offences, added the girl on messaging service WhatsApp, but it was unknown where he got her phone number.
He then sent her messages saying: "Hey sexy, coming on WhatsApp today? x", before asking her repeatedly when she was turning 11.
Depute fiscal Kirsten Thomson told the court that Andrews received child abuse material from other people using online messaging service KiK.
Miss Thomson said Andrews told contacts on KiK that he liked girls aged seven to eight.
A total of 191 indecent images and 11 indecent videos of children were recovered, with several at the most severe level.
A Dundee man who sent sexual texts to a 10-year-old girl has been jailed for two years.