Sets up application to connect to Gmail to send emails (works with an error)