The term spam is derived from the Monty Python SPAM sketch, set in a cafe where everything on the menu includes SPAM luncheon meat. As the server recites the SPAM-filled menu, presently a chorus of Viking patrons drowns out all normal conversation with a song, repeating “SPAM, SPAM, SPAM, SPAM” and singing “lovely SPAM, wonderful SPAM” over and over again, stopping all conversation, hence SPAMming the dialogue. The excessive amount of SPAM in the sketch comes from British rationing in World War II. SPAM was one of the few foods that was not restricted and widely available, so by the time of the sketch, the British were fed up with the luncheon meat. Another similarity is that everything on the menu comes with SPAM, therefore representing that you can’t order something without receiving something you don’t want, much like one can’t be active on the Internet and never have spam sent to your e-mail address(es).
Although the first known instance of unsolicited commercial e-mail occurred in 1978 (unsolicited electronic messaging had already taken place over other media, with the first recorded instance being via telegram on September 13, 1904), the term “spam” for this practice had not yet been applied. In the 1980s the term was adopted to describe certain abusive users who frequented BBSs and MUDs, who would repeat “SPAM” a huge number of times to scroll other users’ text off the screen. In the early Chat rooms in services like PeopleLink and the early days of AOL, they actually flooded the screen with sizeable quotes from the Monty Python routine. This was generally used as a tactic by insiders of a particular group who wanted to drive newcomers out of the room so the usual conversation could continue. This act, previously termed flooding or trashing, came to be called spamming as well.  By analogy, the term was soon applied to any large amount of text broadcast by one user, or sometimes by many users.
It later came to be used on Usenet to mean excessive multiple posting—the repeated posting of the same message. The first evident usage of this sense was by Joel Furr in the aftermath of the ARMM incident of March 31, 1993, in which a piece of experimental software released dozens of recursive messages onto the news.admin.policy newsgroup. Soon, this use had also become established—to spam Usenet was to flood newsgroups with junk messages.
Commercial spamming started in force on March 5, 1994, when a pair of lawyers, Laurence Canter and Martha Siegel, began using bulk Usenet posting to advertise immigration law services. The incident was commonly termed the “Green Card spam”, after the subject line of the postings. The two went on to widely promote spamming of both Usenet and e-mail as a new means of advertisement—over the objections of Internet users they labeled “anti-commerce radicals.” Within a few years, the focus of spamming (and antispam efforts) moved chiefly to e-mail, where it remains today. 
There are three popular fake etymologies of the word “spam”. The first, promulgated by Canter & Siegel themselves, is that “spamming” is what happens when one dumps a can of SPAM luncheon meat into a fan blade. The second is the backronym “shit posing as mail.” The third is similar, using “stupid pointless annoying messages.”
Hormel Foods Corporation, the makers of SPAM® luncheon meat, do not object to the Internet use of the term “spamming.” However, they do ask that the capitalized word “SPAM” be reserved to refer to their product and trademark.  By and large, this request is obeyed in forums which discuss spam—to the extent that to write “SPAM” for “spam” brands the writer as a newbie. However, Hormel has begun to press the trademark issue—first, when a firm registered the trademark “SpamArrest” in 2003, Hormel sued to invalidate the mark, , and more recently two failed attempts to revoke the mark “spambuster”.,