An SMTP session log records the plain-text conversation between a client (your WordPress site, via PHPMailer) and an SMTP server (your relay). The conversation follows a fixed sequence: connect, identify, encrypt, authenticate, specify sender and recipient, transmit message, disconnect. Every step produces a numeric response code. When email delivery fails, the log tells you exactly which step broke and what the server said about it.
WordPress mailer plugins like WP Mail SMTP, Post SMTP, and FluentSMTP can capture these logs. This guide annotates a real session line by line. For the broader WordPress email setup that produces the SMTP session in the first place, see How to set up email on WordPress.
The SMTP conversation in brief
An SMTP session has seven stages:
- Connection – TCP connection to the server on port 587 (TLS), 465 (SSL), or 25
- EHLO – client identifies itself; server lists its capabilities
- STARTTLS – upgrade to encrypted connection (on port 587)
- AUTH – client authenticates with credentials
- MAIL FROM / RCPT TO – envelope sender and recipient
- DATA – message headers and body
- QUIT – session ends
Every server response starts with a three-digit code: 2xx means success, 3xx means "continue" (more input needed), 4xx means temporary failure (retry may work), 5xx means permanent failure (don’t retry). The enhanced status codes (e.g., 2.7.0) provide finer detail – the first digit matches the basic code, the second identifies the category (.7. = security/authentication).
Analyzing an SMTP session
Below is a full SMTP session log that ends up successfully sending an email. In the left column are the different log entries, while the right column shows an explanation.
Raw SMTP session
2023-04-11 10:49:15 Connection: opening to smtp.speedymx.com:587, timeout=300, options=array()
2023-04-11 10:49:15 Connection: opened
2023-04-11 10:49:15 SMTP INBOUND: "220 smtp.speedymx.com Welcome to SpeedyMX mail server v3. - SpeedyMX"
2023-04-11 10:49:15 SERVER -> CLIENT: 220 smtp.speedymx.com Welcome to SpeedyMX mail server v3. - SpeedyMX
2023-04-11 10:49:15 CLIENT -> SERVER: EHLO lab.nanopo.st
2023-04-11 10:49:15 SMTP INBOUND: "250-smtp.speedymx.com"
2023-04-11 10:49:15 SMTP INBOUND: "250-8BITMIME"
2023-04-11 10:49:15 SMTP INBOUND: "250-SMTPUTF8"
2023-04-11 10:49:15 SMTP INBOUND: "250-STARTTLS"
2023-04-11 10:49:15 SMTP INBOUND: "250-HELP"
2023-04-11 10:49:15 SMTP INBOUND: "250 2.0.0 Hi lab.nanopo.st (2a01:7e00::f03c:93ff:fe3b:a774). Nice to meet you, my name is smtp.speedymx.com. - SpeedyMX"
2023-04-11 10:49:15 SERVER -> CLIENT: 250-smtp.speedymx.com250-8BITMIME250-SMTPUTF8250-STARTTLS250-HELP250 2.0.0 Hi lab.nanopo.st (2a01:7e00::f03c:93ff:fe3b:a774). Nice to meet you, my name is smtp.speedymx.com. - SpeedyMX
2023-04-11 10:49:15 CLIENT -> SERVER: STARTTLS
2023-04-11 10:49:15 SMTP INBOUND: "220 Ready to start TLS - SpeedyMX"
2023-04-11 10:49:15 SERVER -> CLIENT: 220 Ready to start TLS - SpeedyMX
2023-04-11 10:49:15 CLIENT -> SERVER: EHLO lab.nanopo.st
2023-04-11 10:49:15 SMTP INBOUND: "250-smtp.speedymx.com"
2023-04-11 10:49:15 SMTP INBOUND: "250-8BITMIME"
2023-04-11 10:49:15 SMTP INBOUND: "250-SMTPUTF8"
2023-04-11 10:49:15 SMTP INBOUND: "250-AUTH LOGIN PLAIN"
2023-04-11 10:49:15 SMTP INBOUND: "250-HELP"
2023-04-11 10:49:15 SMTP INBOUND: "250 2.0.0 Hi lab.nanopo.st (2a01:7e00::f03c:93ff:fe3b:a774). Nice to meet you, my name is smtp.speedymx.com. - SpeedyMX"
2023-04-11 10:49:15 SERVER -> CLIENT: 250-smtp.speedymx.com250-8BITMIME250-SMTPUTF8250-AUTH LOGIN PLAIN250-HELP250 2.0.0 Hi lab.nanopo.st (2a01:7e00::f03c:93ff:fe3b:a774). Nice to meet you, my name is smtp.speedymx.com. - SpeedyMX
2023-04-11 10:49:15 Auth method requested: UNSPECIFIED
2023-04-11 10:49:15 Auth methods available on the server: LOGIN,PLAIN
2023-04-11 10:49:15 Requested auth method not available:
2023-04-11 10:49:15 Auth method selected: LOGIN
2023-04-11 10:49:15 CLIENT -> SERVER: AUTH LOGIN
2023-04-11 10:49:15 SMTP INBOUND: "334 VXNlcm5hbWU6"
2023-04-11 10:49:15 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2023-04-11 10:49:15 CLIENT -> SERVER: bGFiQG5hbm9wby5zdA==
2023-04-11 10:49:15 SMTP INBOUND: "334 UGFzc3dvcmQ6"
2023-04-11 10:49:15 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2023-04-11 10:49:15 CLIENT -> SERVER: UDZsTjhHNTNHUGpM
2023-04-11 10:49:16 SMTP INBOUND: "235 2.7.0 Authentication successful - SpeedyMX"
2023-04-11 10:49:16 SERVER -> CLIENT: 235 2.7.0 Authentication successful - SpeedyMX
2023-04-11 10:49:16 CLIENT -> SERVER: MAIL FROM:<[email protected]>
2023-04-11 10:49:16 SMTP INBOUND: "250 OK - SpeedyMX"
2023-04-11 10:49:16 SERVER -> CLIENT: 250 OK - SpeedyMX
2023-04-11 10:49:16 CLIENT -> SERVER: RCPT TO:<[email protected]>
2023-04-11 10:49:16 SMTP INBOUND: "250 2.0.0 Recipient accepted. - SpeedyMX"
2023-04-11 10:49:16 SERVER -> CLIENT: 250 2.0.0 Recipient accepted. - SpeedyMX
2023-04-11 10:49:16 CLIENT -> SERVER: DATA
2023-04-11 10:49:16 SMTP INBOUND: "354 End data with <CR><LF>.<CR><LF> - SpeedyMX"
2023-04-11 10:49:16 SERVER -> CLIENT: 354 End data with <CR><LF>.<CR><LF> - SpeedyMX
2023-04-11 10:49:16 CLIENT -> SERVER: Date: Tue, 11 Apr 2023 10:49:15 +0000
2023-04-11 10:49:16 CLIENT -> SERVER: To: [email protected]
2023-04-11 10:49:16 CLIENT -> SERVER: From: nanoPost Lab <[email protected]>
2023-04-11 10:49:16 CLIENT -> SERVER: Subject: Test email
2023-04-11 10:49:16 CLIENT -> SERVER: Message-ID: <[email protected]>
2023-04-11 10:49:16 CLIENT -> SERVER: X-Mailer: PHPMailer 6.7 (https://github.com/PHPMailer/PHPMailer)
2023-04-11 10:49:16 CLIENT -> SERVER: MIME-Version: 1.0
2023-04-11 10:49:16 CLIENT -> SERVER: Content-Type: text/plain; charset=UTF-8
2023-04-11 10:49:16 CLIENT -> SERVER:
2023-04-11 10:49:16 CLIENT -> SERVER: Test email
2023-04-11 10:49:16 CLIENT -> SERVER:
2023-04-11 10:49:16 CLIENT -> SERVER: .
2023-04-11 10:49:16 SMTP INBOUND: "250 2.0.0 Email queued for delivery. - SpeedyMX"
2023-04-11 10:49:16 SERVER -> CLIENT: 250 2.0.0 Email queued for delivery. - SpeedyMX
2023-04-11 10:49:16 CLIENT -> SERVER: QUIT
2023-04-11 10:49:16 SMTP INBOUND: "221 Bye - SpeedyMX"
2023-04-11 10:49:16 SERVER -> CLIENT: 221 Bye - SpeedyMX
2023-04-11 10:49:16 Connection: closed
| SMTP Log Entry | Explanation |
| 2023-04-11 10:49:15 Connection: opening to smtp.speedymx.com:587, timeout=300, options=array() 2023-04-11 10:49:15 Connection: opened 2023-04-11 10:49:15 SMTP INBOUND: "220 smtp.speedymx.com Welcome to SpeedyMX mail server v3. – SpeedyMX" 2023-04-11 10:49:15 SERVER -> CLIENT: 220 smtp.speedymx.com Welcome to SpeedyMX mail server v3. – SpeedyMX | Connection establishment: The session begins with a connection attempt to smtp.speedymx.com on port 587. The connection is successfully opened, and the server sends a welcome message. |
| 2023-04-11 10:49:15 CLIENT -> SERVER: EHLO lab.nanopo.st | EHLO command: The client sends an EHLO command to identify itself (lab.nanopo.st) to the server (smtp.speedymx.com). The server responds with a list of supported features, including 8BITMIME, SMTPUTF8, STARTTLS, and HELP. Issue: If the server does not respond or responds with an error, the connection might be rejected, or the client may need to use a different identification method like HELO. |
| 2023-04-11 10:49:15 SMTP INBOUND: "250-smtp.speedymx.com" 2023-04-11 10:49:15 SMTP INBOUND: "250-8BITMIME" 2023-04-11 10:49:15 SMTP INBOUND: "250-SMTPUTF8" 2023-04-11 10:49:15 SMTP INBOUND: "250-STARTTLS" 2023-04-11 10:49:15 SMTP INBOUND: "250-HELP" 2023-04-11 10:49:15 SMTP INBOUND: "250 2.0.0 Hi lab.nanopo.st (2a01:7e00::f03c:93ff:fe3b:a774). Nice to meet you, my name is smtp.speedymx.com. – SpeedyMX" | The server responds with a list of supported features, including 8BITMIME, SMTPUTF8, STARTTLS, and HELP. Note: If the server does not respond or responds with an error, the connection might be rejected, or the client may need to use a different identification method like HELO. |
| 2023-04-11 10:49:15 CLIENT -> SERVER: STARTTLS | STARTTLS command: The client sends a STARTTLS command to initiate a secure connection. |
| 2023-04-11 10:49:15 SMTP INBOUND: "220 Ready to start TLS – SpeedyMX"2023-04-11 10:49:15 SERVER -> CLIENT: 220 Ready to start TLS – SpeedyMX | The server acknowledges this request and is ready to begin TLS. Note: If the server does not support TLS or there is a problem with the TLS handshake, the secure connection might fail, leading to email transmission issues. |
| 2023-04-11 10:49:15 CLIENT -> SERVER: EHLO lab.nanopo.st | EHLO command again: The client sends another EHLO command after establishing the secure connection to re-negotiate the supported features. |
| 2023-04-11 10:49:15 SMTP INBOUND: "250-smtp.speedymx.com" 2023-04-11 10:49:15 SMTP INBOUND: "250-8BITMIME" 2023-04-11 10:49:15 SMTP INBOUND: "250-SMTPUTF8" 2023-04-11 10:49:15 SMTP INBOUND: "250-AUTH LOGIN PLAIN" 2023-04-11 10:49:15 SMTP INBOUND: "250-HELP" 2023-04-11 10:49:15 SMTP INBOUND: "250 2.0.0 Hi lab.nanopo.st (2a01:7e00::f03c:93ff:fe3b:a774). Nice to meet you, my name is smtp.speedymx.com. – SpeedyMX" | The server responds with a new list of supported features, including AUTH LOGIN and PLAIN. |
| 2023-04-11 10:49:15 Auth method requested: UNSPECIFIED 2023-04-11 10:49:15 Auth methods available on the server: LOGIN,PLAIN 2023-04-11 10:49:15 Requested auth method not available: 2023-04-11 10:49:15 Auth method selected: LOGIN | Client and server agree on the authentication method (LOGIN) |
| 2023-04-11 10:49:15 CLIENT -> SERVER: AUTH LOGIN | Client initiates authentication process |
| 2023-04-11 10:49:15 SMTP INBOUND: "334 VXNlcm5hbWU6" 2023-04-11 10:49:15 SERVER -> CLIENT: 334 VXNlcm5hbWU6 | Server requests username (base64-encoded) |
| 2023-04-11 10:49:15 CLIENT -> SERVER: bGFiQG5hbm9wby5zdA== | Client sends base64-encoded username |
| 2023-04-11 10:49:15 SMTP INBOUND: "334 UGFzc3dvcmQ6" 2023-04-11 10:49:15 SERVER -> CLIENT: 334 UGFzc3dvcmQ6 | Server requests password (base64-encoded) |
| 2023-04-11 10:49:15 CLIENT -> SERVER: UDZsTjhHNTNHUGpM | Client sends base64-encoded password |
| 2023-04-11 10:49:16 SMTP INBOUND: "235 2.7.0 Authentication successful – SpeedyMX" 2023-04-11 10:49:16 SERVER -> CLIENT: 235 2.7.0 Authentication successful – SpeedyMX | Server confirms successful authentication Note: If the provided credentials are incorrect or the authentication method is not supported, the server may reject the connection or require a different authentication method. |
| 2023-04-11 10:49:16 CLIENT -> SERVER: MAIL FROM:[email protected] | MAIL FROM command: The client sends the MAIL FROM command, specifying the sender’s email address ([email protected]). |
| 2023-04-11 10:49:16 SMTP INBOUND: "250 OK – SpeedyMX" 2023-04-11 10:49:16 SERVER -> CLIENT: 250 OK – SpeedyMX | Server confirms sender acceptance |
| 2023-04-11 10:49:16 CLIENT -> SERVER: RCPT TO:[email protected] | RCPT TO command: The client specifies the recipient’s email address ([email protected]). |
| 2023-04-11 10:49:16 SMTP INBOUND: "250 2.0.0 Recipient accepted. – SpeedyMX" 2023-04-11 10:49:16 SERVER -> CLIENT: 250 2.0.0 Recipient accepted. – SpeedyMX | Server confirms recipient acceptance. Note: If the recipient’s email address is invalid or the server rejects it, the email cannot be sent. |
| 2023-04-11 10:49:16 CLIENT -> SERVER: DATA | DATA command: The client sends the DATA command to signal that it is ready to send the email content. |
| 2023-04-11 10:49:16 SMTP INBOUND: "354 End data with <CR><LF>.<CR><LF> – SpeedyMX" 2023-04-11 10:49:16 SERVER -> CLIENT: 354 End data with <CR><LF>.<CR><LF> – SpeedyMX | Server acknowledges and prepares to receive email data |
| 2023-04-11 10:49:16 CLIENT -> SERVER: (email content, including headers, body, and attachments) | Email content transmission: The client sends the email content, including headers and body, line by line. |
| 2023-04-11 10:49:16 CLIENT -> SERVER: . | Client signals the end of the email data with a single period (.) |
| 2023-04-11 10:49:16 SMTP INBOUND: "250 2.0.0 Email queued for delivery. – SpeedyMX" 2023-04-11 10:49:16 SERVER -> CLIENT: 250 2.0.0 Email queued for delivery. – SpeedyMX | Email queued for delivery: the server responds with a 250 status code, indicating that the message has been accepted and is queued for outbound delivery. Some servers (Postfix, for example) include a queue ID in this response (250 2.0.0 Ok: queued as 1234567890ABCDEF), which can be cross-referenced with mail-server logs to trace the message. Note: if the message format is invalid or the server cannot accept it, this is where a 5xx permanent failure or 4xx temporary failure appears instead. |
| 2023-04-11 10:49:16 CLIENT -> SERVER: QUIT | QUIT command: The client sends a QUIT command to terminate the session |
| 2023-04-11 10:49:16 SMTP INBOUND: "221 Bye – SpeedyMX" 2023-04-11 10:49:16 SERVER -> CLIENT: 221 Bye – SpeedyMX | Server acknowledges the QUIT command and ends the SMTP session |
| 2023-04-11 10:49:16 Connection: closed | Connection between client and server is closed |

