Safari gives me this error sometimes. The fix I use is to refresh the page. In Mail, the equivalent fix would be closing and restarting the program.
I'm assuming you're getting the "Document contains no data" error - this is almost always a weird internet glitch that occurs sometimes for everyone.