The first electric telegram was sent by Samuel F. B. Morse on May 24, 1844. Note that this isn't the only telegraph system, others came prior to the Morse telegram. It was 1838 when Morse first successfully tested his device. Alfred Vail, Morse's assistant, developed the Morse code.
In 1843 Congress funded Morse's experimental telegraph line from Washington to Baltimore. On May 24th 1844 sending the message "What hath God wrought" from Numbers 23:23
If you'd like to read more on telegraph history Click Here This web page has several links to various articles.