Face it, we have all received the dreaded rejection letter. I don't know but there is something about receiving a paper letter that makes it more "real" than an e-mail - perhaps it is the fact you can physically tear paper into bits - but whatever form the letter takes, the sting can hurt. It can also make you do one of two things: step up and figure out whether there is a flaw in your product that you can fix; or pout and blame it on the ineptitude of the author of said rejection. Clearly the second option feels better for about five minutes. Then most professionals would move back to option one.
Some rejection letters give clues regarding what might have gone south for you. Perhaps the agent or publishing house doesn't represent or print the type of story you have. That goes back to your research and not their lack of ability to see the next bestseller. If that is your problem, then perhaps it would behoove you to actually pay attention to the statement of what a given agent/publisher says they will accept.
Often the letter will tell you specific details about why your work was not accepted. Perhaps it was too long; or the writing good but not salable. It happens. And it can help you write better.
The question is how will you handle it? Because how you decide to cope with this business of rejection is important. It is also critical to your ability to enter the publishing fray for the long haul. Expect rejection, but do not court it by submitting things too quickly and without forethought for the recipient. If the entity asks for 5 pages, don't send the whole manuscript. If they say they only publish e-books, don't ask for print copies. These seem silly, but as much as these points beg the obvious, you would be surprised how many people do not read details regarding submissions. And, bottom line, not everyone can be an author published traditionally. Sometimes enough rejections despite your best efforts to make a work salable is a clue that being an author is not your forte.
Regardless, it is important to accept receiving rejections as part of the business of writing professionally.