Some Bitcoin wallets have this functionality: they let you encrypt an arbitrary text with a Bitcoin address such that only the owner of the address can read the text.
The Monero wallet software allows you to sign a message with your own private keys, but I'm asking about encrypting with someone else's [public] address. (I'm not asking about embedding messages in transactions.)