"The Genius of China: 3000 Years of Science, Discoveries and Inventions", Simon and Schuster, New York, by Robert Temple, 1986. is a highly informative and beautifully illustrated volume for the lay reader on the major contributions of China to science and technology---a collection of highlights from Sir Joseph Needham's monumental multi-volume treatise: "Science and Civilization of China'. (To my regret, Temple's book is already out of print.) The following is quoted from Chapter 5 on Medicine and Health (pp.135-137):
" The origins of inoculation against smallpox in China are somewhat mysterious. We know that the technique originated at the southern province of Szechuan. In the south-west of that province there is a famous mountain called O-Mei Shan which is known for its connection with both Buddhism and the native Chinese religion of Taoism. The Taoist alchemists who lived as hermits in the caves of that mountain possessed the secret of smallpox inoculation in the tenth century AD. How long before that they had it we shall never know.
The technique first came to public attention when the eldest son of the Prime Minister Wang Tan (957-1017) died of smallpox. Wang desperately wished to prevent its happening to other members of his family, so he summoned physicians, wise men and magicians from all over the Empire to try to find some remedy. One Taoist hermit came from O-Mei Sand, described variously as a 'holy physician', a 'numinous old woman' (in which case a nun), and a 'ouija board immortal' (ouija boards or planchettes were widely used in China, where whole books were written through 'spirit dictation'). This monk or nun brought the technique of inoculation and introduced it to the capital....
Inoculation against smallpox in China did not become widely known and practiced until the period 1567-72, according to the author Yu T'ien-Chih. Vivid descriptions of the practice are recorded by Yu Chang in his book Miscellaneous Ideas in Medicine, of 1643.
During the seventeenth century, the practice spread to the Turkish regions, and it was here that it came to the attention of Europeans. The wife of the British Ambassador to Constantinople, Lady Mary Wortley Montagu (1689-1762) allowed her family to be 'variolated' in 1718. Four years before this, E. Timoni had published an account of the practice in the Philosophical Transactions of the Royal Society in London, and two years after that, J. Pilarini published a further account in the same source. So the process was being much discussed in London and Lady Mary must have been encouraged by that to take her bold step. By 1721, variolation (called then 'engrafting') began to be widely practiced in Europe as protection against smallpox. We owe to this transmission from China the later developments of vaccination and the science of immunology itself....".