Unable to connect to smtp server
So I mailed my hosting provider for some addition information about the server, the logs and such. And it turns out that they did not allow any traffic on port 587 except for traffic going to the google ip addresses. However google has recently changed the addresses for their smtp servers and the hosting provider did not.

So if there is anyone with a similar problem, I suggest you contact your hosting provider to see if they allow traffic to the google ip's on port 857 and if those ip's are correct.