This is obviously a very divisive one - and you have no way of knowing how it will be received as, presumably, if you were friends of the owners, you would have mentioned it to them when chatting.
Some people may appreciate it, and you'll hear all the stories where it worked; but, as PPs have said, other people could react very negatively to it. Fair enough if it's a generic headed estate agent's letter: "Dear Littleham district resident... if you're considering selling your house, we have people who are looking to move to the area..." - but targeting one specific house can be really upsetting.
People will say "What have YOU got to lose", but it's not just about you. You may be a very pleasant person asking just on the off-chance, and perfectly happy to accept No, but many people will feel stalked and don't know what your intentions might be.
My DGM had severe MH problems, meaning that her house wasn't in the best state of repair (despite our best efforts to encourage her - she had the money to pay for work, but anybody she didn't know well coming to her house really worried her). She was also housebound for several years and obviously elderly.
She had several of these kind of letters put through the door from individuals. They were polite enough, but they were clearly not saying that it was their dream house, rather thinking they could get a bargain/something they could afford. Thankfully, she wasn't really able to deal with her own post, so we were able to intercept these letters before she could see them.
If she had thought that somebody had been eyeing up her home and wanted her out so that they could move in - especially as, when the only resident is in her 80s or 90s, we all know what the expectation might be for why the house might become vacant - it would have sent her over the edge and caused her a great deal of lasting trauma.
Even if she hadn't been mentally unwell, I think a lot of elderly people will feel very differently when the home where they feel safe and hope to live in until they die is targeted; as opposed to, say, a young family who may well be thinking of moving up or away and won't naturally feel that somebody is waiting for them to die and hoping to jump in and benefit following their death.
Aside from these issues, I would still be very suspicious of somebody who did this. I'd wonder why they weren't waiting to see if the house was put on the market at some point. Targeting and saying "Please let me know if you're considering selling" does strongly suggest that they want to swoop to limit your opportunity to likely get considerably more if you put it on the open market. If they keep watch, see that it's gone up for sale and then make the very best offer, they will most probably get the house anyway - only without putting unwelcome pressure on the seller prematurely.
I just think it's weird, really: there's a very obvious, established way of making it known that you want to sell your house - even if it's just putting a home-made for sale board of your own outside if you don't like/want to use estate agents - thus not respecting this is overstepping boundaries imho. It's not like they wouldn't know how to go about marketing their house, if they wanted to, and see no option but to wait and hope for somebody to come along and ask to buy it. You wouldn't go to a friend's house and randomly ask if they wanted to sell their belongings, as if their home were a shop; so why would you target strangers in this way?