All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The supplication that is mentioned in regard to drinking milk is what is mentioned in the Hadeeth narrated by Ibn 'Abbaas that the Prophet said: "When one of you eats food, let him say: “O Allaah! Bless us in it and give us food better than it”, and when he drinks milk, he should say: “O Allaah! Bless us in it and give us more of it”.” [Ahmad, Abu Daawood and At-Tirmithi]
Milk, as it is known, comes from camels, cows and sheep; Allaah confers upon His Slaves His blessing of giving them milk to drink saying (what means): {And indeed, for you in grazing livestock is a lesson. We give you drink from what is in their bellies —between excretion and blood — pure milk, palatable to drinkers.}[Quran 16:66]
Livestock consists of the cattle of camels, cows and sheep. Also, milk includes normal milk and curdled milk.
In his Al-Qaamoos al-Muheet, Al-Fayroozabaadi defines milk as follows: “Milk is what is milked (from livestock), or the milk that has not changed.”
Also, Lisaan Al-‘Arab (a famous Arabic dictionary) reads: “Milking is to take out the milk from the udder of sheep, camels or cows ... you say I drank milk…”
However, in our view, we do not say the above supplication (O Allaah! Bless us in it and give us more of it) when eating cheese, because even though cheese is made from milk, it is not called milk. It is for this reason that a group of jurists, may Allaah have upon them, are of the view that if one makes an oath not to drink milk, he does not break his oath if he eats cheese. So, the above supplication is said only when drinking milk, while the other dairy products are not included in it as most of them are not considered as a drink. Hence, it is not correct to say that one has "drunk cheese".
As regards when one mixes milk with coffee, then we do not know of any evidence in regard to supplicating when drinking it, but we hope that it is permissible to say this supplication when drinking it if the milk is more than the coffee, but if the coffee is more than the milk, then no. We say this based on what the jurists, may Allaah have mercy upon them, mentioned in case a person makes an oath not to drink milk “… If he drinks pure milk, he breaks his oath, and if he mixes it with something else, then he breaks his oath if the milk dominates the other ingredient by its color or taste, and he does not break his oath if the other ingredient dominates with its color or taste. This is what Al-Maawirdi said. In case neither ingredient dominates over the other, then it is more likely that one breaks his oath as researched by some late scholars ".
Thus, the jurists based breaking the oath on the dominance of the milk. The same thing applies to the supplication.
As regards your question “Is there any effect when saying it?”, then the answer is that the mentioned supplication is like any other supplication; if Allaah responds to the supplication of a person, then there is no doubt that Allaah will place blessing for him in this milk, and the body will benefit from it. However, there are some conditions and etiquettes that should be met for the supplication to be answered, and if the person who supplicates fails to abide by all or some of them, then his supplication may not be answered. For more benefit, please refer to Fataawa 83421 and 85023.
Allaah Knows best.