Okay, so after all of that, my mail worked for about 2 hours after I posted that message, and then it once again started giving me the "connection failed" message.
BUT, I went to the MobileMe support page and started a chat with a support representative, and +she actually fixed it!!+
It's been two days, and no problems. I've been waiting to post this just to make sure that everything is still working, and I've sent a LOT of test messages from my iPhone MobileMe account in that time and they've all worked fine. No more errors.
So, if anyone is still having this problem -- at least with MobileMe -- I highly recommend getting in touch with MobileMe support at
http://www.apple.com/support/mobileme/ Under "Get help with MobileMe," I selected "MobileMe Mail" and then "Other Mail questions." Click on Chat Now and then describe the problem to the support rep. My rep had me do some stuff with turning off Push, deleting my MobileMe mail account from my iPhone, adding it new, and then she did a few things on her end with the account.
As I say, since then, I've had no problems whatsoever, and it's been two days now. I don't know if contacting iPhone support can help in a similar way with gmail, Yahoo!, or Exchange accounts. But if you are having trouble with one of those, the Apple support page says that iPhone users have two years of support (as long as you still have an active wireless plan on your phone), and so you can call:
~ U.S. iPhone technical support: 1-800-MY-IPHONE (1-800-694-7466)
~ Canada technical support: 1-800-263-3394
Or go to
http://www.apple.com/support/contact/phone_contacts.html to find phone numbers for other countries.
Hope this helps!