A former partner who refused to leave his ex alone continued to message her, despite being jailed.