I asked ChatGPT:
How would you use Java 8 to make a TLS socket for SMTP like for smtp.gmail.com port 587?
GPT-3.5 was hopeless and produced nonsense. GPT-4 was somewhat better but kept producing code that failed. Each time I would tell it how it failed and ask it to test its own code. It seems to ignore requests to test its code, and keeps giving me modified code that fails. So I gave up.