The first momentary communication was established between Washington, D.C. and San Francisco on the 24th of October, 1861. The workers of the Western Union Telegraph Company link the eastern and western telegraph networks of the nation at Salt Lake City, Utah. The first telegram in history was sent from Stephen J. Field, chief justice of California to President Abraham Lincoln. The message was a sort of a proof of the loyalty of the western states to the Union, as the country was at the Civil War. Actually, nobody expected the Western Union to complete the telegraph line that early. But they successfully coped with the task and the message was delivered!

More Info: history.com