A man sent a threatening message that he would rape a woman, court documents show.