We use it quite often in Spain. It is similar to "mandar todo a tomar vientos". If you say "esta a tomar por culo" o "esta a tomar vientos" both mean something is far away, but preceded by the verb mandar it means the same as "mandar todo a la mierda": send everything to hell, as indicated in the previous answer. I guess we use it when we are really fed up with something or frustrated and we want to quit. Stop making the effort. On the other hand, if it is referred to someone as "mandar a alguien a la mierda" or if it is the person you are speaking to "vete a la mierda!" it it just the same as go to hell, fuck off etc.
Edit: leyendo tu comentario se refiere a no mandar el matrimonio a la mierda, no destrozarlo, no acabar con él, en definitiva divorciarse.