Anyway, using the instructions in the link you provided, I was able to successfully connect and send test emails using both ports 465 and 587.
So the problem isn’t with making an email connection from the computer running Gitea. Which seems to bring us back to the problem being an issue with Gitea itself. (Hopefully it’s just a configuration issue and not some bug.)
FYI (and for anyone else reading this thread), the example statement on that link for connecting to port 465 is incorrect. It should just be:
openssl s_client -connect example.com:465
not as shown:
openssl s_client -starttls smtp -connect example.com:465
because for port 465 SSL is implicit.