I'm assuming that you can get email at home on your WiFi network. Can you access the Internet at all when you're away from home? i.e. if you use Safari, can you see any websites at all?
Remember, too, that the iPad will always try to use WiFi in preference to 3G and so, if you're in the presence of another WiFi network (i.e. you can see the WiFi signal 'fan' icon) then your iPad will be trying to connect to the Internet using that connection. Even if it can't, it (bizarrely) won't switch to 3G. So you might need to switch off the WiFi in 'Settings' and try again.
Another point - have you had the O2 SIM for long? Do you know whether it's been authorised yet? We've had several Members with similar problems who subsequently discovered that the SIM had not yet been authorised.
Tim