YORK — Kara DioGuardi’s fame as a writer on some 50 hit songs, including many about love, nearly pulled the plug on her own Maine romance 10 years ago.

DioGuardi had become smitten with Maine building contractor Mike McCuddy. The two met when McCuddy was building a house next door to a vacation property DioGuardi owned in Prospect Harbor. The pair hit it off and things seemed to be going well, until a mutual friend told McCuddy that he should look up DioGuardi’s website. He saw the names of celebrity pop stars DioGuardi worked with – Gwen Stefani, Britney Spears and Christina Aguilera to name a few – and was stunned. He couldn’t imagine himself, from the tiny western Maine town of Phillips, having a serious relationship with someone who works with such glitterati.

“I called her up and told her I didn’t think it was going to work,” said McCuddy, 42, who had taught art in Orono schools for five years. “The whole thing seemed so foreign to me,”

“I read him the riot act for judging me, thinking he knew all about me from a website,” said DioGuardi, 45.

As it turned out, DioGuardi would gain fame for being a judge herself. In 2009 and 2010, she judged singers on the hit TV show “American Idol.” By then, McCuddy had long forgotten his reservations. He moved to Los Angeles to be with DioGuardi, and the couple married in 2009. They settled in York in 2010, to be close to McCuddy’s daughter from a previous marriage. They have a 3-year-old son, Greyson.

DioGuardi is putting her judging skills to work in her adopted home. She is one the organizers, and one of the judges, for an Oct. 11 event called New England Sings, at the 700-seat Ogunquit Playhouse. The event is a fundraiser for several groups and causes, including the Ogunguit Playhouse, Enough Abuse Campaign, York County Family Fund, My Breast Cancer Support and First Parish of York Outreach.

It’s part of a busy schedule DioGuardi keeps that includes continued work in music, for which she travels at least once a month. A song she helped write for Kelly Clarkson, “Heartbeat Song,” went to No. 21 on the Billboard singles chart last year. She has her own music publishing company, where she helps develop the careers of other songwriters, and she teaches at Berklee College of Music in Boston.

“I didn’t know anything about her when we met, but I quickly saw that she had a passion for using the gifts given her to help others,” said the Rev. Anna V. Copeland, senior pastor at First Parish Church of York, where DioGuardi attends services. “She’s a really grateful person. She knows she has much to share and she’s grateful for that.”

‘THE BEST THERAPY I NEVER PAID FOR’

DioGuardi’s living room, which has two banks of windows and glass doors looking out at the tidal flats of the York River, has few trappings of her music career on display, aside from a piano in one corner. On a recent afternoon, she had just finished a meeting at her home to discuss details of the New England Sings event, and her laptop was still open to audition videos. She walked into the living room softly singing a little of the 1974 Redbone hit “Come and Get Your Love,” but she had no idea why.

She said she’s excited about New England Sings because of the causes it will raise money for, and because she’s passionate about helping develop young talent. Growing up in a “type A” household in the suburbs of New York City, DioGuardi said she suppressed her own drive to create music. She said she knew she could sing but was afraid to sing in front of people. And she was constantly creating melodies in her head. But she focused on getting good grades and “trying to be like everyone else.”

Her father, Joseph DioGuardi, was a partner at the accounting firm Arthur Andersen and served as a Republican representative from New York from 1985 to 1989. Her parents favored Frank Sinatra, Doris Day, opera and church music, while DioGuardi was turning up the volume on Aretha Franklin records as loud as she could. She loved soul and rock, hits of the ’70s and ’80s, and anything by Prince.

She went to college at Duke University and was miserable. She became depressed, and by the time she graduated in 1993, she knew she had to change her life. She moved back to New York, eventually joined a garage rock band, and started writing songs in hopes of getting her band signed to a record deal.

“Part of going through the depression was taking a look inside myself, and for me, writing songs was a way to learn about myself, it allowed me to look at my own emotions and express them,” said DioGuardi. “It was the best therapy I never paid for.”

While trying to break into music in New York, she also worked at Billboard magazine. She eventually landed in the sales department. She worked all day at the magazine and worked on music at night.

WORDS RING TRUE

By the late 1990s, DioGuardi was writing full time. She soon found that other musicians could relate to what she was writing, and she started recording her songs. She lived off money she saved while at Billboard. That was important, she said, because unlike other struggling songwriters she didn’t need to sell the publishing rights from her songs to support herself. Instead she retained the rights to her songs.

Her first big break came when British singer Martine McCutcheon recorded one of her songs, “I’ve Got You,” which became a top 10 single in England. That lead to other musicians and songwriters listening to her songs. Singer Paula Abdul heard a tape of DioGuardi’s songs (before either one of them was an “American Idol” judge) and wanted to write with her.

DioGuardi and Abdul then worked together to write “Spinning Around,” which was later recorded by Australian pop star Kylie Minogue. Other writers on the song included Ira Shickman and Osborne Bingham. The song won Best Pop Release at the Australian music awards in 2000.

Kara DioGuardi sits at her piano in her York home. She credits her stint as a judge on "American Idol" in 2009 and 2010 with building her confidence and giving her some name recognition, which she hopes to put to good use. "If I hadn't been on 'Idol' you might not be here now letting me tell people about New England Sings," she said, of the upcoming benefit event. Gregory Rec/Staff Photographer

Kara DioGuardi sits at her piano in her York home. She credits her stint as a judge on “American Idol” in 2009 and 2010 with building her confidence and giving her some name recognition, which she hopes to put to good use. “If I hadn’t been on ‘Idol’ you might not be here now letting me tell people about New England Sings,” she said, of the upcoming benefit event. Gregory Rec/Staff Photographer Gregory Rec/Staff Photographer

Then DioGuardi’s songwriting career took off. She worked on songs that were recorded by Ricky Martin, Jessica Simpson, Enrique Iglesias, Marc Anthony, Celine Dion and Spears. The songs she writes lyrics for range from bouncy dance hits to more introspective ballads.

Some 50 songs she’s worked on have been charted radio hits. Several of the songs she worked on, always with at least one co-writer and sometimes more, made it to the Top 10 of the Billboard singles chart. Those include: “Pieces of Me” by Ashlee Simpson in 2004; “Rich Girl” by Stefani in 2005; and “Ain’t No Other Man” by Aguilera in 2006. She’s worked on No. 1 country hits, too, including “Undo It” by Carrie Underwood in 2010 and “This” by Darius Rucker in 2011.

SONGS COME FROM WITHIN

DioGuardi says she mostly works on words and melodies when she writes as a part of a team. Ideas and specific lines come from her own life, what she’s feeling and thinking. She wrote some of “Heartbeat Song”, a No. 21 hit for Clarkson last year, about her son.

DioGuardi had tried to get pregnant through in vitro fertilization several times, with no success, before she and her husband decided to use a surrogate. Several lines in “Heartbeat Song” come from her own thoughts about the surprising feeling of having a tiny baby to care for, though she was never pregnant: “You, where the hell did you come from? You were a different, different kind of fun. And I’m so used to feeling numb.”

DioGuardi says most of the songs she works on are the result of a session with other writers and sometimes the singer. Among her most memorable sessions was one with Pink. She and the singer had tried writing together previously, but it went poorly.

“I think I talked too much. I probably should have shut up and listened to her,” DioGuardi said. “So when I got a call a year later and they said she wanted to work with me, I said ‘Are you sure she wants me?’ ”

To prepare for the second session, DioGuardi said she listened to “every Pink song I could get my hands on” to get into the singer’s “head space.” The two got along much better this time and shared a couple glasses of wine.

“I proceeded to get very drunk. I don’t drink that much and I had like two glasses on a somewhat empty stomach,” DioGuardi said. “I remember thinking I may throw up on her.”

But she didn’t, and the two ended up writing a song Pink later recorded. It was called “Sober,” though it had nothing to do with the wine drunk at the session. Pink had the title, and the last line of the song written, when she met with DioGuardi.

DioGuardi said she likes songs to come out of conversations about everyday life. She and Dave Stewart of the Eurythmics wrote “Taking Chances” for Dion after talking about taking a chance together to form a band. (They called it Platinum Weird, and made one album together.)

DioGuardi and Underwood wrote “Mama’s Song” while talking about weddings. Underwood had recently met her husband-to-be and DioGuardi was about to get married. They both lamented that, while the bride’s father gives her away and gets the first dance, what recognition does the mother get during the wedding? She should have a song, they agreed.

Her songwriting success lead to DioGuardi being asked to be a judge on “American Idol” for two seasons. She called the time on the show “a wild ride” and still marvels at how much makeup she was made to wear. She also wishes she could have given the singers constructive advice before they sang, instead of just after. But overall she said the experience gave her a lot of confidence to speak publicly and some name recognition, which she hopes to use to good effect.

“If I hadn’t been on ‘Idol’ you might not be here now letting me tell people about New England Sings,” she said.

GETTING INVOLVED

DioGuardi wants to get more involved in causes she feels are important. Her main issue right now is child sexual abuse. She says she was molested by a family friend when she was 11 and he was 18. She said it happened once and, even though “there were after effects, I’ve had a great life and I feel really good.” But because she’s spoken about her experience and because she’s well-known, advocates for child sex abuse victims have helped her learn about the scope of the problem.

“Until these groups started coming to me, I had no idea how much of an epidemic this is,” she said. “These groups have reached out to me, to speak, and it’s helping me learn.”

DioGuardi said she’s taking a course through a Harvard Law School extension program that deals with international law and children.

The New England Sings event will benefit Enough Abuse Campaign, as well as several other local charities and the Ogunquit Playhouse. DioGuardi said that her pastor, Copeland, first suggested doing some sort of show at the church. But DioGuardi didn’t want to be judging other church members. So she proposed making it a bigger event and wanted to get other causes involved.

“I want to celebrate talent, but I also want to get young minds to realize there are a lot of great organizations doing great things,” DioGuardi said.