Connect to an SMTP server, capture its banner + EHLO capabilities, and test STARTTLS.
Many hosting providers (incl. DigitalOcean) block outbound port 25 by default. Use 587 (submission) or 465 (SMTPS) if 25 times out.