Open Question: Will okay alright to just write a resignation letter?

I have decided to quit my current job because I just do not like the way I am being treated there. My question is if it's alright to just send in a resignation letter instead of going in and telling my boss I quit? I have too many things going on right now to go in there and let my boss know my decision. So can I just send a resignation letter? Thank-you.