See this Comm Center thread by Jim Morse. The example in the docs for GMail has the deprecated port 465 listed and it is not needed. Use TLS and no port number.