Criminal harassment, commonly referred to as stalking, refers to unwanted or obsessive attention by an individual or group toward another person. Stalking behaviors are related to harassment and intimidation and may include uttering threats, following the victim in person or monitoring them.
Although stalking is illegal in most areas of the world, some of the actions that can contribute to stalking can be legal, such as gathering information, calling someone on the phone, sending gifts, emailing or instant messaging. They become illegal when they breach the legal definition of harassment. For example, an action such as sending a text message is not usually illegal, but becomes illegal when frequently repeated to an unwilling recipient.
The best way to approach the situation, understand your rights and formulate a winning defence is to speak to a lawyer who has knowledge and experience in the areas that most affect you.