Q. When someone gives Tzedaka during the Yohrzait of a good friend in his memory, since the friend is not longer alive and there in likely no mitzva of “Vehavata Lereacha” (love your friend) anymore. Which mitzva is actually involved, so he can have the essential and crucial intention for it?
A. It is obvious that helping the poor and destitute is always a great mitzva, however knowing if there is an additional mitzva being complied with in this particular situation may be indeed important.
Generally speaking, we rule that when a person fulfills a Torah Mitzvah, Kavanah or proper intention to comply, is essential in order for it to count. Kavanah means that a person must have in mind that he is fulfilling the Mitzvah of Hashem as found in the Torah, so knowing which mitzva it is seems necessary. This would seem to be the case in regard to Chessed as well.
However, many Poskim have written that although it is required ideally, if one did not have the correct Kavana, the Mitzvah still counts, post facto.
The Chazon Ish was of the opinion that this concept of not receiving credit for a Torah Mitzvah when one does it by rote without intent does not apply in regard to Mitzvos that are between man and man (Toraso Yeh’ge, Miluim #10).
On question 363 regarding intention on social mitzvos we wrote: Horav Shlomo Miller Shlit’a pointed out that in regards to Kavanah in Mitzvos, there is a difference between the commandments Ben Adam Lamakom, or the ones that involve only complying with the will of Hashem and the ones that additionally benefit others or society too. On the former you need intention, on the latter, it is generally accepted that after the fact you comply with the Mitzvah even if performed without intention, as the benefit was done nonetheless.
However, the Chofetz Chaim holds that kavanah, or intent to perform a mitzvah, is also required and essential for those mitzvos. (Ahavas Chessed 2:23).
In our particular case, Horav Shlomo Miller’s Shlit’a opinion is that since after all a person is still being judged during the Yamim Noraim after his death, as it involves the consequences and effects that his life actually had on the past year, and that judgment is very meaningful for the living, therefore donating Tzedaka in his name, is also part of the mitzva of “Vehavata Lereacha.”
See also question 2104.
Rabbi A. Bartfeld as revised by Horav Shlomo Miller, Horav Dovid Pam, Horav Aharon Miller and Horav Chanoch Ehrentreu and Horav Kalman Ochs Shlit'a