The last time I got rejected I said "That's fine, I'm okay with being just your friend" and otherwise very deliberately avoided any sort of serious emotional investment... mostly because the time before that I got really depressed, made some rather unfortunate comments and ostracized myself from this girl whom I had been friends with since middle school.
The following is not intended to give you false hope, but my first girlfriend, and long time friend broke up rather abruptly (she dumped me, I saw it coming but didn't want to admit it). And then, the next year panned out with me being depressed as hell, lashing out at everyone and just being very emotional in general. She did something that made me feel completely betrayed, and so I cut off contact with a message telling her how I felt. That was it, for about 3 years. Then she added me on Facebook, which was shocking to me because of how "out of the blue" it was. So then I thought about it, accepted and let it settle for a minute. The next day she messaged me and basically said look, I wanna talk, can I come over, so I said sure. When she got to my house, she apologized for the way she acted after the breakup, after some awkward catching up chatter. And you know what? That was all I really wanted from her in the first place. Just an acknowledgement that I had been hurt, and it was pretty much entirely her fault at the time. Both of us had done a lot of growing up since we started dating, so it was pretty much the perfect time. It gave me the confidence and lift that let me go back and put myself out there. I'm single again, but I've been in a handful of relationships since all this went down. I'm better for it, though.
Anyway, sorry for this big ol' wall, but I just knew I could relate. And uh, yeah. Just hold your head up, like Argent said.
Edit: Oh, and it's probably worth mentioning that we're on very good terms now.