The Shulhan Aruch (Orah Haim 472) rules that if drinking wine causes one some physical discomfort, he must nevertheless try to drink the four cups of wine at the Seder. Of course, if possible, one should use a valid substitute such as grape juice. But even if there is no other option, and drinking will cause some discomfort, such as a headache, one should still drink the four cups of wine.
However, this refers only to one who would experience some discomfort, but not to somebody whose health would be endangered by drinking wine. If a person has a condition such as high blood pressure or diabetes, and drinking wine could be injurious his health, or he would become bedridden, then certainly he is exempt from the obligation. The Shulhan Aruch speaks only of a person for whom wine causes some discomfort, but not of somebody who would actually become sick if he drank wine.
This Halacha gives rise to the broader question of whether a Beracha is recited over a food or drink that causes one discomfort. The Shulhan Aruch, as mentioned, ruled that one must drink four cups of wine at the Seder even if this causes discomfort, and such a person would recite the Beracha of "Boreh Peri Ha’gefen" over the wine. How does this apply to other foods that are injurious to one’s health? For example, we know that foods with MSG and with large quantities of salt or sugar are harmful. Does one recite a Beracha over such foods?
The Gemara addresses the case of one who drinks olive oil, which was considered to be injurious to one’s health. According to Rashi’s understanding of the Gemara, one does not recite a Beracha when drinking olive oil, because it is detrimental and not beneficial. This ruling is codified in the Shulhan Aruch (Orah Haim 202). Should we deduce on the basis of this Halacha that one should not recite a Beracha over any unhealthful food?
Hacham Ovadia Yosef (citing the Sedeh Hemed and other sources) writes that a distinction needs to be drawn between unhealthful foods that have a pleasing taste and other foods. He explains that Rashi and the Shulhan Aruch rule that no Beracha is recited over olive oil because it is detrimental to one’s health and it does not have an enjoyable taste. If, however, a food has an enjoyable taste, one recites a Beracha over the food even if it is unhealthful. Hacham Ovadia draws proof to this ruling from the comment of the Rambam (Rav Moshe Maimonides, Spain-Egypt, 1135-1204) that truffles and mushrooms are detrimental to one’s health. The Gemara rules that one recites a Beracha over such foods, thus proving that a Beracha is recited over tasty foods that are unhealthful. This is true of carob, as well; the Gemara says that one recites "Ha’etz" over carob, yet the Rambam writes that carob is injurious to one’s health. Likewise, the Gemara comments that one recites "She’hakol" over barley flour, despite the fact that the Gemara also notes that ingesting barley flour causes parasites. Since this food has a pleasing taste, one recites a Beracha, despite its detrimental effect on one’s health.
(It should be noted that the Shulhan Aruch rules that one who drinks vinegar by itself does not recite a Beracha. This ruling does not apply to the vinegar we have today, which is not nearly as potent and acidic as the vinegar used centuries ago. One who drinks vinegar nowadays would, in fact, recite "She’hakol." The Shulhan Aruch also speaks of bitter nuts, and writes that no Beracha is recited when one eats this food. These nuts were so bitter that they provided no enjoyment whatsoever, and thus no Beracha is recited.)
Another example of this Halacha would be a person with lactose intolerance who eats ice cream. Even though the ice cream will cause a stomachache, he nevertheless recites a Beracha because of its pleasant taste.
Hacham Ovadia writes (in Hazon Ovadia - Pesah, Responsa) that this applies to wine at the Seder, as well. One recites a Beracha over the wine even though it would cause him discomfort, because the wine has an enjoyable taste. This case differs from olive oil, which is unhealthful and does not have a pleasant taste. (Surprisingly, the Ben Ish Hai, in Parashat Pinhas, writes that one who drinks olive oil recites the Beracha of "She’hakol" – in direct contradiction to the explicit ruling of the Shulhan Aruch. Later Halachic authorities, including Hacham Bension Abba Shaul and Hacham Ovadia Yosef, question the Ben Ish Hai’s ruling.)
In any event, this requirement – to drink four cups of wine even if wine causes one some discomfort – underscores the importance of this Misva. We must all ensure to fulfill this obligation properly, recognizing its Halachic significance.
It should be noted that it is customary to use specifically red wine for the four cups at the Seder. The Shulhan Aruch rules that Mebushal wine is acceptable for use for the four cups, though it is preferable to use wine that is not Mebushal (Mishna Berura). The wine used for the four cups does not have to be sweet wine, and it does not have to have a high alcohol content.
Both men and women are obligated to drink the four cups of wine. Children from the age of 5 or 6 should also be given some wine or grape juice, though they need not be given the minimum required Shiur (amount) of wine.
Summary: If drinking wine is injurious to one’s health, he is exempt from the Misva of four cups of wine at the Seder. If, however, drinking wine is not injurious to his health, but will cause some degree of physical discomfort (such as a headache), he should fulfill the Misva. In such a case, he recites the Beracha of "Boreh Peri Ha’gefen" as usual. In general, one recites a Beracha over food that could cause him discomfort, or is unhealthful, as long as it has a pleasing taste (such as unhealthful sugary foods).