How to Fix email sending error on the iPhone

iPhone has an exceptionally enjoyable inbuilt Mail app, and I have used it to configure my Gmail account on it. However, today while, connecting to my newly configured office WiFi network the app refused (not literally) to send emails. It placed them in the outbox and gave a “sending failed” error (unable to connect SMTP… blah blah).
After fighting for over 30 minutes; I seem to have a solution. Kinda silly and uncluttered …
I tried almost everything from rebooting the WiFi router, Modem, toggling WiFi on and off on the iPhone etc. But what actually helped was this:Go to Safari, open any webpage. Once that connects and opens a website shut it, and the mail app starts to behave just brilliant!
I am running a 1st Gen iPhone with firmware 2.2. Got similar tips to share? Feel free to drop me a comment below… 🙂