People say that but the drops and pills make zero difference.
Sun sure does feel good, but the vitamin additives does not have the same effects. Based on that one could make the conclusion that it is not vitamin d but something else with sunlight that is beneficial.
Yes, recent studies have shown that Vitamin D is the marker that's associated with whatever process sun exposure induces. It's not the vitamin itself causing the benefits. Get some sun, just not too much.