An SMTP session is a plain-text dialogue: EHLO, MAIL FROM, RCPT TO, DATA, then the message. The server answers each step with a three-digit code: 2xx accepted, 4xx temporary failure (retry later), 5xx permanent rejection.
Between mail servers SMTP runs on port 25. Mail clients and applications should send on port 587 (submission with STARTTLS) or 465 (implicit TLS) with authentication. Many cloud providers block outbound port 25 by default.
When mail does not arrive, the SMTP reply code in the log or the bounce message is the most useful piece of information. The enhanced status code such as 5.7.1 narrows down the cause.
Example
openssl s_client -connect mail.example.com:587 -starttls smtp