We can't help with the SMTP server since it is specific to the account in use, but the port should be 2525 if all else fails according to their pages.
But if you can't connect to Gmail or SMTP to go I would say the printer can't access the internet (You should be getting encryption errors if you were reaching a server that it can't access, not connection failures)
So look to your DNS server (if all else fails try 8.8.8.8 as the primary DNS server).
Make sure the Gateway is right.
Verify if you have a Proxy server, because if you do, the printer needs to know to use it.
If the printer is on Https, the time needs to be correct (within 3 minutes) or it will fail to scan.