You can search iCloud Mail for email messages containing specific text in any of the fields.
Search email messages
In the sidebar, click an item (the Inbox or a folder, for example) you want to search.
Click Search above the message list, type the text you want to find, then select the field you want to search in: From, To, Subject, or All.
To see all messages again, click the Delete button in the search field.