Unfortunately, the advice of all three people didn't help. Curiously, if I change the case from -layer=> 'tls',
to -layer=> 'TLS', then the error messages change entirely:
...
Net::SMTPS=GLOB(...etc...)>>>> EHLO localhost.localdomain
Net::SMTPS=GLOB(...etc...)>>>> 250-smtp.gmail.com at your service ..
+.
Net::SMTPS=GLOB(...etc...)>>>> 250-SIZE 35882577
Net::SMTPS=GLOB(...etc...)>>>> 250-8BITMIME
Net::SMTPS=GLOB(...etc...)>>>> 250-STARTTLS
Net::SMTPS=GLOB(...etc...)>>>> 250-ENHANCEDSTATUSCODES
Net::SMTPS=GLOB(...etc...)>>>> 250-PIPELINING
Net::SMTPS=GLOB(...etc...)>>>> 250-CHUNKING
Net::SMTPS=GLOB(...etc...)>>>> 250 SMTPUTF8
Net::SMTPS=GLOB(...etc...)>>>> AUTH LOGIN
Net::SMTPS=GLOB(...etc...)>>>> 530 5.7.0 Must issue a STARTTLS comma
+nd first ... Authentication (SMTP) failed
but note that one of the messages confirmed STARTTLS already.