A health board mistakenly published the email addresses of nearly 40 people who have HIV.
It is understand that 37 NHS Highland patients were able to see their own and other people's contact details in an email from the board.
The message was an invitation to a support group run by a sexual health clinic at Raigmore Hospital, Inverness.
NHS Highland has said it "deeply" regretted the breach of confidentiality. A spokeswoman said the NHS had contacted each patient affected to apologise.
She said: "As per normal procedure, a formal internal review is being conducted to understand how this has happened and to consider any steps to avoid this happening in future."
The charity HIV Scotland has described the breach as "unacceptable".
Chief executive Nathan Sparling said: "Confidentiality is of paramount importance when it comes to people living with HIV, and the decision to disclose their status should be theirs and theirs alone.
"People affected by this leak will be understandably distressed, and HIV Scotland stands ready to support all those affected."