In early 1964, Roddenberry presented a brief treatment for a proposed Star Trek TV series to Desilu Productions comparing it to Wagon Train, "a Wagon Train to the stars.” Desilu worked with Roddenberry to develop the treatment into a script, which was then pitched to NBC.

NBC paid to make a pilot, "The Cage", starring Jeffrey Hunter as Enterprise Captain Christopher Pike. NBC rejected The Cage, but the executives were still impressed with the concept, and made the unusual decision to commission a second pilot: "Where No Man Has Gone Before".

The first regular episode ("The Man Trap") of Star Trek: The Original Series aired on Thursday, September 8, 1966.

While the show initially enjoyed high ratings, the average rating of the show at the end of its first season dropped to 52nd (out of 94 programs).

Unhappy with the show's ratings, NBC threatened to cancel the show during its second season. The show's fan base, led by Bjo Trimble, conducted an unprecedented letter-writing campaign, petitioning the network to keep the show on the air. NBC renewed the show, but moved it from primetime to the "Friday night death slot", and substantially reduced its budget.

In protest Roddenberry resigned as producer and reduced his direct involvement in Star Trek, which led to Fred Freiberger becoming producer for the show's third and final season. Despite another letter-writing campaign, NBC cancelled the series after three seasons and 79 episodes.

More Info: en.wikipedia.org