How to Verify SMTP Connectivity After Configuration (Optional)

  1. Check STARTTLS (Port 587) with OpenSSL
openssl s_client -starttls smtp -connect smtp.mailgun.org:587 -quiet

If you see the certificate and extended capabilities such as 250-STARTTLS, it means the handshake was successful. An example of normal output is as follows:

depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root G2
verify return:1
depth=1 C = US, O = DigiCert Inc, CN = DigiCert Global G2 TLS RSA SHA256 2020 CA1
verify return:1
depth=0 C = US, ST = Texas, L = San Antonio, O = "MAILGUN TECHNOLOGIES, INC", CN = *.mailgun.org
verify return:1
250 STARTTLS
  1. Send a test email with swaks (if installed)
swaks \
  --server smtp.mailgun.org --port 587 \
  --auth LOGIN --auth-user postmaster@your-domain.com --auth-password 'YOUR_PASS' \
  --tls --from noreply@your-domain.com --to you@your-domain.com \
  --header 'Subject: SMTP test from Sk2' --body 'hello from Sk2'

If the configuration takes effect, you will receive the corresponding email in your inbox.

The above are only methods for checking connectivity/credentials; the template/alert emails within the business still depend on the actual system configuration.