A former law student from Sunderland has been given a suspended prison sentence after being found guilty of attempted sexual communication with a child.