Was sunlight the only way to receive vitamin D in AD times?

No. Milk has also existed in AD times as well.