FAQ #15563, published on 2017-10-03
How to avoid certificate error when using EmailStartSMTPSession with smtp.gmail.com ?
Errors might randomly occur when using EmailStartSMTPSession with smtp.gmail.com because some Google certificates can't be verified by Windows. This problem is likely to be fixed by Google eventually.

In the meantime an easy solution is to add this line to your code :


// insert before calling EmailStartSMTPSession
EmailConfigure
(emailParameterMode, 1)