If you want to offer condolences for a relative stranger, use this sympathy letter as a sample.
Although you don't know me, I wanted to tell you how sorry I was to hear about the death of {Name}. I met your {relation} on a number of occasions over the last {period of time} at {event/location/etc.}. I found {him/her} warm, friendly and incredibly sharp.
I'm sorry I never got the chance to become closer to {Name} and your family, and I'm so sorry for your devastating loss.