He was educated at the University of Edinburgh, and went to London in 1723 to work as a private tutor. There he became friendly with Alexander Pope, James Thomson, and other literary figures. His best-known work was written in the same year: William and Margaret, adapted from a traditional ballad. In 1740, he collaborated with Thomson on a masque, Alfred, which was the vehicle for Rule Britannia. His other plays and poetry, popular at the time, are largely forgotten, but he was a significant enough figure to be chosen by Henry St John, Viscount Bolingbroke as his literary executor. Bolingbroke's writings were edited and published by Mallet in 1754.