First up, I don't think this is particularly unusual. He's 12 and challenging the boundaries, just like toddlers do, and just like chidlren do at various stages of their lives. A way of him taking control in his life is to refuse to go to school.
So what can you do? Well you need to be consistant yet at the same time you need to make it clear it is not acceptable. I would be explaining in great detail the impact that not attending school will have. The reputation he will gain, the lack of choice it will lead to - after aall if you don't go to school, what college will take you in future? Who will emply you? No job = no home etc etc etc...
In a few years he has the chance to shape his destiny, at 16 he needs to decide which direction to go in but the choices he makes now will adversely affect all he does. An intelligent child will need to process this.
Secondly, saying you will send him away is not an option imo. You're giving up and you can't do that. You need to send him the message that you will NOT give up on him and that you are determined to support him.
Thirdly you need regular meetings with the school. Have you given him options on schooling? IE "You have to go to school but we can look at whether there is a school that suits you better". Talk about the means to an end, make sure he knows why you want him there.
Make certain there are no underlying issues - it seems strange he was fine and is now unhappy. Are you sure there is no bullying? But if you are, I would be taking him to school in pjs if needs be, I have done that with mine.