To use the Gmail server, change host to ‘smtp.gmail.com’. Try that, and it should attempt to log in with your provided credentials.
I should add that if you opened port 587 just for this feature, you should close it as it is not needed to be opened for only outgoing mail.