The mitzva of mishlo’aĥ manot is designed to increase love and harmony between fellow Jews. Therefore, one who sends mishlo’aĥ manot to his friend anonymously does not fulfill his obligation. Matanot la-evyonim, on the other hand, is like charity and is designed to help the poor in the best possible manner. Therefore, when possible, it is preferable to give matanot la-evyonim anonymously.
One can fulfill the mitzvot of mishlo’aĥ manot or matanot la-evyonim by inviting one’s friend to the Purim meal. If one wants this meal to count as mishlo’aĥ manot, he should place two portions of food in front of his friend, simultaneously, and tell him that this is his mishlo’aĥ manot (Kaf Ha-ĥayim 695:42).
If he wants to fulfill the mitzva of matanot la-evyonim through this meal, it is preferable not to state this outright to the poor person, so that he receives the gift in a more respectable manner, with love and joy. Indeed, this is a very beautiful way to fulfill the mitzva. Similarly, one can anonymously give gifts to the poor in the form of mishlo’aĥ manot containing good and useful food, such that the poor person will not be embarrassed and will even think that the mishlo’aĥ manot was given to him out of love, not due to his poverty.
It is preferable for one so spend more liberally on his gifts to the poor than with his festive meal and with sending portions to his friends, for there is no greater or more glorious joy than gladdening the hearts of the poor, the orphans, the widows, and the converts. One who gladdens the hearts of these unfortunate people resembles the Divine Presence, as it says: “Reviving the spirits of the lowly, reviving the hearts of the contrite” (Yeshayahu 57:15). (mt, Laws of Megilla 2:17)
In other words, technically, everyone may decide how to prioritize his expenditures – in mishlo’aĥ manot and the se’uda or in matanot la-evyonim. However, one who wants to fulfill the mitzva according to the guidance of our Sages should, le-khatĥila, give precedence to spending more on matanot la-evyonim. Thus, one should calculate how much he will spend on mishlo’aĥ manot and the Purim meal and give more than that to the poor. One who gives ma’aser kesafim each month to the poor or to Torah students may include ma’aser kesafim in this calculation. Therefore, if, together with ma’aser kesafim, one gives more to the poor than he expends on mishlo’aĥ manot and the Purim meal, he has beautified the mitzva in accordance with the guidance of the Sages, and he will, consequently, be privileged to experience the “great and glorious joy” that Rambam mentioned.
According to some Aĥaronim, one cannot give both mishlo’aĥ manot and matanot la-evyonim to the same person.