SmtpReplyCode uses ConstantsTrait
SMTP reply codes (RFC 5321 §4.2, with RFC 4954 / 7504 extensions).
The three-digit reply returned by an SMTP server after each command. The leading digit defines the outcome class:
| 2yz | Positive completion — command accepted | | 3yz | Positive intermediate — more input expected | | 4yz | Transient negative — try again later | | 5yz | Permanent negative — do not retry (bounce) |
Constants are grouped by class and ordered by value, mirroring HttpStatusCode.
SmtpReplyCode::getType ( 250 ) ; // 'Positive Completion'
SmtpReplyCode::isTransient( 451 ) ; // true (retry)
SmtpReplyCode::isPermanent( 550 ) ; // true (bounce)
Tags
Table of Contents
Constants
- AUTH_CHALLENGE : int = 334
- AUTH_INVALID : int = 535
- AUTH_REQUIRED : int = 530
- AUTH_SUCCESSFUL : int = 235
- BAD_SEQUENCE : int = 503
- CANNOT_ACCOMMODATE_PARAMETERS : int = 455
- CANNOT_VERIFY : int = 252
- COMMAND_NOT_IMPLEMENTED : int = 502
- DOES_NOT_ACCEPT_MAIL : int = 521
- DOMAIN_DOES_NOT_ACCEPT_MAIL : int = 556
- ENCRYPTION_REQUIRED : int = 538
- EXCEEDED_STORAGE : int = 552
- HELP : int = 214
- INSUFFICIENT_STORAGE : int = 452
- LOCAL_ERROR : int = 451
- MAILBOX_NAME_NOT_ALLOWED : int = 553
- MAILBOX_NOT_FOUND : int = 550
- MAILBOX_UNAVAILABLE : int = 450
- OK : int = 250
- PARAMETER_NOT_IMPLEMENTED : int = 504
- PASSWORD_TRANSITION_NEEDED : int = 432
- SERVICE_CLOSING : int = 221
- SERVICE_NOT_AVAILABLE : int = 421
- SERVICE_READY : int = 220
- START_MAIL_INPUT : int = 354
- SYNTAX_ERROR : int = 500
- SYNTAX_ERROR_IN_PARAMETERS : int = 501
- SYSTEM_STATUS : int = 211
- TEMPORARY_AUTH_FAILURE : int = 454
- TRANSACTION_FAILED : int = 554
- USER_NOT_LOCAL : int = 551
- USER_NOT_LOCAL_WILL_FORWARD : int = 251
Methods
- getDescription() : string|null
- Returns a short human-readable description of a reply code.
- getType() : string|null
- Returns the outcome class of a reply code.
- isPermanent() : bool
- Whether the code is a permanent negative (`5yz`) — the message bounced and must not be retried.
- isPositive() : bool
- Whether the code is positive (`2yz` completion or `3yz` intermediate).
- isTransient() : bool
- Whether the code is a transient negative (`4yz`) — delivery failed for now but may succeed if retried later.
Constants
AUTH_CHALLENGE
public
int
AUTH_CHALLENGE
= 334
AUTH_INVALID
public
int
AUTH_INVALID
= 535
AUTH_REQUIRED
public
int
AUTH_REQUIRED
= 530
AUTH_SUCCESSFUL
public
int
AUTH_SUCCESSFUL
= 235
BAD_SEQUENCE
public
int
BAD_SEQUENCE
= 503
CANNOT_ACCOMMODATE_PARAMETERS
public
int
CANNOT_ACCOMMODATE_PARAMETERS
= 455
CANNOT_VERIFY
public
int
CANNOT_VERIFY
= 252
COMMAND_NOT_IMPLEMENTED
public
int
COMMAND_NOT_IMPLEMENTED
= 502
DOES_NOT_ACCEPT_MAIL
public
int
DOES_NOT_ACCEPT_MAIL
= 521
DOMAIN_DOES_NOT_ACCEPT_MAIL
public
int
DOMAIN_DOES_NOT_ACCEPT_MAIL
= 556
ENCRYPTION_REQUIRED
public
int
ENCRYPTION_REQUIRED
= 538
EXCEEDED_STORAGE
public
int
EXCEEDED_STORAGE
= 552
HELP
public
int
HELP
= 214
INSUFFICIENT_STORAGE
public
int
INSUFFICIENT_STORAGE
= 452
LOCAL_ERROR
public
int
LOCAL_ERROR
= 451
MAILBOX_NAME_NOT_ALLOWED
public
int
MAILBOX_NAME_NOT_ALLOWED
= 553
MAILBOX_NOT_FOUND
public
int
MAILBOX_NOT_FOUND
= 550
MAILBOX_UNAVAILABLE
public
int
MAILBOX_UNAVAILABLE
= 450
OK
public
int
OK
= 250
PARAMETER_NOT_IMPLEMENTED
public
int
PARAMETER_NOT_IMPLEMENTED
= 504
PASSWORD_TRANSITION_NEEDED
public
int
PASSWORD_TRANSITION_NEEDED
= 432
SERVICE_CLOSING
public
int
SERVICE_CLOSING
= 221
SERVICE_NOT_AVAILABLE
public
int
SERVICE_NOT_AVAILABLE
= 421
SERVICE_READY
public
int
SERVICE_READY
= 220
START_MAIL_INPUT
public
int
START_MAIL_INPUT
= 354
SYNTAX_ERROR
public
int
SYNTAX_ERROR
= 500
SYNTAX_ERROR_IN_PARAMETERS
public
int
SYNTAX_ERROR_IN_PARAMETERS
= 501
SYSTEM_STATUS
public
int
SYSTEM_STATUS
= 211
TEMPORARY_AUTH_FAILURE
public
int
TEMPORARY_AUTH_FAILURE
= 454
TRANSACTION_FAILED
public
int
TRANSACTION_FAILED
= 554
USER_NOT_LOCAL
public
int
USER_NOT_LOCAL
= 551
USER_NOT_LOCAL_WILL_FORWARD
public
int
USER_NOT_LOCAL_WILL_FORWARD
= 251
Methods
getDescription()
Returns a short human-readable description of a reply code.
public
static getDescription(int|string $code) : string|null
Parameters
- $code : int|string
-
The reply code.
Return values
string|null —The description, or null when the code is unknown.
getType()
Returns the outcome class of a reply code.
public
static getType(int|string $code) : string|null
Parameters
- $code : int|string
-
The reply code.
Return values
string|null —One of Positive Completion, Positive Intermediate,
Transient Negative or Permanent Negative; null if out of range.
isPermanent()
Whether the code is a permanent negative (`5yz`) — the message bounced and must not be retried.
public
static isPermanent(int|string $code) : bool
Parameters
- $code : int|string
-
The reply code.
Return values
boolisPositive()
Whether the code is positive (`2yz` completion or `3yz` intermediate).
public
static isPositive(int|string $code) : bool
Parameters
- $code : int|string
-
The reply code.
Return values
boolisTransient()
Whether the code is a transient negative (`4yz`) — delivery failed for now but may succeed if retried later.
public
static isTransient(int|string $code) : bool
Parameters
- $code : int|string
-
The reply code.