A review published in the journal Nutrients discusses a great deal of research that indicates vitamin D provides protection against internal infection. It regulates both innate (inborn, quick acting, short lived) immunity and acquired (promoted by response to an invasive organism and producing a long-lasting effect) immunity.
The researchers extoll the virtues of vitamin D in increasing the strength of both forms of immunity, and state that vitamin D deficiency is associated with an increased risk for various infections, including HIV, respiratory tract and HCV infection. However, when discussing the efficacy of vitamin D supplementation, they state that “robust data from controlled trials investigating the use of vitamin D as a preventive or therapeutic agent are missing.”
Unfortunately, the researchers indicate that sun exposure would be a good way to obtain vitamin D in correct amounts, but then destroy that argument by stating that …”UVB radiation is also the main cause of human skin cancer, thus it is difficult, if not impossible, to make a general recommendation to expose the skin to the sun for sufficient vitamin D synthesis.”
They are wrong, of course. Common skin cancers cause very few deaths, and melanoma, the deadly cancer, is far less common in people who are regularly exposed to sunlight, compared to those who avoid the sun. Outdoor workers have about half the risk of contracting melanoma as do indoor workers.
Another problem that the researchers have with sun exposure as a vitamin D source is this: People who live at high latitudes do not produce any vitamin D from sun exposure in the winter, because there is no UVB light at that time of year. My response to this is the following: Use UVB lamps or sunbeds. Such a suggestion would probably cause the authors of this researchers to melt down. I can hear them screaming “melanoma!” already. I would then direct them to a 20-year study from Sweden, which showed that women who used sunbeds during that 20 years had a 23% reduction in all-cause death risk compared to those who avoided sunbeds. And, they were not at increased risk of melanoma. Also, the subjects in the study who avoided sun exposure were twice as likely to die of any cause compared to those who had the highest sun exposure.
At almost any place on earth, we now have either the sunshine or UVB lamps that can give us the vitamin D we need and the other photoproducts that protect us from myriad diseases, including various infections. It is a shame that too many fail to take advantage.
 Juliana de Castro Kroner, Andrea Sommer and Mario Fabri. Vitamin D Every Day to Keep the Infection Away? Nutrients 2015, 7, 4170-4188.
 Godar D, Landry, R, Lucas, A. Increased UVA exposures and decreased cutaneous Vitamin D3 levels may be responsible for the increasing incidence of melanoma. Med Hypotheses 2009;72(4):434-43.
 Pelle G. Lindqvist, Elisabeth Epstein, Mona Landin-Olsson, Christian Ingvar, Kari Nielsen, Magnus Stenbeck & Håkan Olsson. Avoidance of sun exposure is a risk factor for all-cause mortality: results from the Melanoma in Southern Sweden cohort. J Intern Med. 2014 Jul;276(1):77-86.