In the pre-computer days, "attachment" and "enclosure" referred to business letters.
An "attachment" would usually mean pages stapled to a letter. They are attached and won't come loose. They are logically separate from the letter and aren't part of the letter. For example, there might be two pages stapled together. The first page is a letter. It has a printed "letterhead" at the top, "Dear so-and-so," several paragraphs, "Sincerely yours," and a signature. The letter might say "Please see the attached invoice. Note that our terms are net thirty." The second page is the invoice.
An "enclosure" would be something that is inside the same envelope, but not stapled to the letter. For example, the letter might say "Thank you so much for your donation. Enclosed please find two tickets to our annual meeting." You open the envelope, and start to pull out the letter, and two tickets slide out and fall on the table. A letter with enclosures ought to have a part that says "enclosed please find," listing all the enclosures, so you can make sure you have them all and they didn't get lost.
An "appendix" is part of a book or a paper. It is usually at the end. You are supposed to read through the book or paper, but not the appendix. The appendix contains supporting factual material. It might have table of data, for example, or charts, or graphs. If the book were, say, a biography of Christopher Columbus, there might be an appendix containing one of Columbus' own letters. The appendix might have maps of the trip. It's not part of the narrative; it's like the "bonus extras" on a DVD.