There are a number of posts out there walking you through the processes of setting up an EMail client on various Linux Desktops. I've used a fare number of them myself. And one of the things that remain a constant (headache) is getting GMail to work in Evolution.
As I mentioned in the outset, there are a number of walkthroughs on this topic. This is more like an amendment or an 'if all else fails'. Check out this post on Ubuntu Docs "https://help.ubuntu.com/community/UsingGmailWithEvolution" it is very easy to follow and has helpful links. The only thing is that GMail has an IMAP setting. I recommend you choose that instead of POP. Here's why: "http://mail.google.com/support/bin/answer.py?hl=en&ctx=mail&answer=75725".
Once you go through the setting up of your email client, you click 'Apply' and you reply "Great! It worked" or "Great! It didn't work". If your reply was that latter, your not alone, read on.
Unfortunately simply adding the port :995 for IMAP/POP and :465 or :587 for SMTP behind the server name doesn't work (at leas for us).
I ran the "dig" command in a terminal and found the ip addresses of the gmail servers.
Command: dig smtp.gmail.com. Witch resulted in:
;; ANSWER SECTION:
smtp.gmail.com. 78 IN CNAME gmail-smtp-msa.l.google.com.
gmail-smtp-msa.l.google.com. 300 IN A 126.96.36.199
Command: dig imap.gmail.com. Witch resulted in:
;; ANSWER SECTION:
imap.gmail.com. 300 IN CNAME gmail-imap.l.google.com.
gmail-imap.l.google.com. 300 IN A 188.8.131.52
I then replaced the server name:port with ip address:port like so:
On the 'Receiving Email' tab; 184.108.40.206:993 and on the 'Sending Email' tab; 220.127.116.11:465. Clicked 'OK' then 'Close' and "Great! It worked".
To further test I added 18.104.22.168 smtp.gmail.com and 22.214.171.124 imap.gmail.com to my /etc/hosts file and changed ip address:port to server name:port method to find that this also worked.
In conclusion, 'if all else fails' use the ip address:port method or simply add the ip address and hostname to your /etc/hosts file.
smtp.gmail.com = 126.96.36.199
imap.gmail.com = 188.8.131.52
pop.gmail.com = 184.108.40.206
smtp.googlemail.com = 220.127.116.11
imap.googlemail.com = 18.104.22.168
pop.googlemail.com = 22.214.171.124
Thanks and comments are welcome