J.K. Rowling is known to interact with her fans on social media, but it turns out the author also takes the time to respond to fan mail, something that Harry Potter star Evanna Lynch said helped her at a very difficult time in her life.

“My most memorable year would be 2006, which is when I booked the role [of Luna Lovegood] in Harry Potter, because I was the biggest fan,” Lynch said on the Monday, October 8, episode of Dancing with the Stars. “I just adored the Harry Potter franchise and Luna Lovegood was my favorite character, so it was just like a lot of things to process at once.”

The actress then revealed that, prior to booking the role, she had been struggling with an eating disorder and took to the beloved series as an escape from her illness, eventually reaching out to Rowling and developing a pen-pal friendship with her.

“When I was like 11, 12, I was battling an eating disorder … And the only thing that could actually take my attention apart from that was the Harry Potter series,” she said. “I started writing to J.K. Rowling and she wrote back and we became pen friends after that. I was in and out of hospital and I would be getting these letters.”

The friendship between the DWTS season 27 contestant and the beloved author had no bearing on the casting process, but Lynch said that, even before landing the role of a lifetime, Rowling’s work and letters had a huge impact on her recovery. “Her books and her kindness really made me want to live again,” she said.

Lynch went on to star as Lovegood in the final four installments of the Harry Potter film series, including Harry Potter and the Order of the Phoenix, Harry Potter and the Half-Blood Prince, and Harry Potter and the Deathly Hallows Parts 1 and 2.

Are you surprised to hear that J.K. Rowling kept up a pen-pal friendship with Evanna? Let us know @BritandCo.

(photo via David M. Benett/Getty Images for Lumos)