Well, the settings for the accounts are located in Mail's preference file (~/Library/Preferences/com.apple.mail.plist), but not the passwords; those are stored in your Keychain folder, also in Library.
I'm not sure whether it would work to transfer that to another computer, but maybe it's worth a shot. Perhaps try copying both the preference file and the keychain file to the proper locations on the new computer?