This is the electoral history of James Buchanan.
He was the 15th president of the United States (1856-1860); 17th United States Secretary of State; United States Minister to the United Kingdom and Russia; U.S. representative from Pennsylvania's third (1821-1823) and fourth congressional district (1823-1831); and U.S. senator from Pennsylvania (1834-1845).
Source (Popular Vote): Leip, David.
Dave Leip's Atlas of U.S. Presidential Elections.
(a) The popular vote figures exclude South Carolina where the Electors were chosen by the state legislature rather than by popular vote.