Ex is giving address to inmates

I’m asking this question for a good friend. Her ex is in prison for 12 years. He has been giving her address to other inmates, showing them pictures of their young girls and then telling them to write to her. I have read some of the letters, they are very disturbing and scary really. She has asked his case worker at the prison to tell him to stop, but it is unclear how effective that will be. My question is if it doesn’t stop can she get a restraining order against him to stop this? Is there any other legal way to put an end to this? I’m concerned for her safety and for her girls. There are now at least 3 inmates who have her address and know that she is a woman living alone with 2 young girls.
Thank you,

Yes, it is possible for your friend to apply for a restraining order, which is called a domestic violence protective order (DVPO), for the reason of continued harassment if his actions are inflicting substantial emotional distress. She may also consider discussing this issue with a law enforcement officer as harassment can be criminal conduct.