I've been asked a few times in the last two weeks how to move all of the mail in Snow Leopard to a clean install of OS X Lion. The actual process isn't difficult; it's the same one I've been using for a while with our own Macs for a clean install of Leopard, Snow Leopard, or Lion.
The process involves moving the Mail preferences, the Mail files, and the Apple Keychain, which hold the passwords for your various email accounts.
Of course, to actually move the Apple Mail accounts and data over, you need a working copy of Snow Leopard. If you have already erased the drive that housed your Snow Leopard version of Mail, then you are in for a much more difficult process, one that requires you to restore Snow Leopard and Mail from a backup. But assuming Snow Leopard and your old Apple Mail files are still intact, here are the basics for moving all the relevant data to your clean install of OS X Lion.
You may also find this list of how to move important Mac data from one Mac to another helpful in your move to OS X Lion: