I'm using namecheap's DNS records for a domain and I've setup the A records so both my www.website.net and website.net point to the samve IP and it works.
I've then setup mail.website.net as an MX record, preference 10.
I also setup an A record for mail2.website.net and also mail2.website.net as an MX preference 20.
My understanding and goal is that mail1 is going to server 1 and mail2 is going to server 2. Since mail2 has a higher preference number, any incoming email will go to mail1 (and thus server 1). Then it server1 goes off line, any incoming email will be routed to mail2 (and thus server 2).
However when I turn off (or delete my site) on server 1 and send me an email it bounces back showing me the IP of server 1 didn't like the email.
When I put the IP of server2 in for server1 everything works on server2 (thus my email settings are correct).
My hope is that if server1 goes done and email will be routed to server2 based on the MX record, but it doesn't appear to work.
The setup for MX record priority works exactly as you are currently setting up. If you have a MX10 and an MX20 and the MX10 goes does, it should fall back to the MX20. If only MX10 is working, I would double check the A record used to map server2 to the MX20 record. If you are running your own server, I would also suggest refreshing the server so that you don't have any caching/TTL issues.