Pete Clapp is right - but I did help my friend too by using this method. Im not sure about HTC, but it did work with friends phones. U just need to find the PROXY, and delete that.
I did this on Samsung Note 1 & it also worked on my friends S2, S3, Galaxy Note 2. I know the below instruction isn't for HTC, but is just deleting the Access Point Name:
Step 1: Go to Settings > Mobile networks > Access Point Names> (then click into your mobile/network provider) EG: AT&T, Optus, Vodafone etc etc.
Step 2: Click into PROXY, then write down the proxy number on a paper, then remove the proxy numbers so that it's blank, then press OK.
Once you've removed the proxy details, Gmail should work & able to download apps from Play Store.
You might need to restart your phone before the changes take effect.
Keep that proxy number you wrote down or save in your phone as a message. This will help you if there's any changes needed if phone updates.
Hope this helps for your HTC. I wrote this cos thought smart phones now days are pretty much a same, if u need to locate the PROXY, it'll be in Settings & Network provider etc etc.
Mr AC (Mr Answers.Comments)