At the beginning of the 19th Century the optical telegraph was the fastest method of carrying dispatches. A 'young' American government offered $30,000 dollars to anyone who could build a semaphore telegraph 1,600 kilometers long. The task seemed impossible.
Then, in 1837, Samuel Morse heard about it and presented to Congress his joint invention with Alfred Vail.
The method of operation was to transfer short and long signals by closing an electrical circuit using a telegraph key in short and long intervals. Signals in the form of dots, dashes and pauses (from a pre-determined table of codes) were translated into letters. This system became known as Morse Code.
All of these devices preceded the invention of the telephone, which itself uses properties of electric current and the operating principle of mechanical devices.