An Auckland man undertook a six-year harassment campaign against a woman he met online, culminating in him posting doctored pornographic images of her online.

Robert Harris, 31, was sentenced to six months' home detention, 100 hours' community work, and a ban on internet usage for six months in the North Shore District Court on Tuesday afternoon.

Harris, who is unemployed, tried to emphasise through his lawyer Jan Leaming that he did not want to be known as a "stalker", but he understood that he needed help.

The 31-year-old met his victim online when he was 25 and she was 19.

They bonded over music before Harris began a "prolonged period of quite serious harassment", Judge Jonathan Down said.

"You made contact with the woman initially as an online friend. You shared music...you wanted romance and she rejected that."

"You clearly became angry about that and you persisted with your contact with her...despite her request that you stop. It got worse," the judge said.

"You say your communication with her wasn't sinister, but I disagree."

Harris doctored a series of pornographic images, adding the head of his victim, and posted them online.

Down quoted the victim, who was not present in court, as having said: "Every time I Googled my name, these images would appear."

After his victim complained in December last year, Harris was warned by police not to contact the woman anymore. But he continued to do so.

"You made veiled threats, you abused her, you placed her name on a dating website so that she was getting unwanted attention."

He was later visited by police and formally warned again. His victim had to complain to police again in May and one more in July when Harris contacted her.

"The last contact referred to the potential for romance and marriage," the judge said.

His victim reported losing sleep during the harassment.

"It must have had a very significant impact on her," Judge Down said.

Harris pleaded guilty to one harassment charge and was sentenced to six months' home detention without internet , plus 100 hours' community service, a 12-month non-association order forbidding him from contacting his victim, and a further six months' post-detention conditions.