Export (0) Print
Expand All

SmtpStatusCode Enumeration

Specifies the outcome of sending e-mail by using the SmtpClient class.

Namespace:  System.Net.Mail
Assembly:  System (in System.dll)

type SmtpStatusCode

Member nameDescription
BadCommandSequenceThe commands were sent in the incorrect sequence.
CannotVerifyUserWillAttemptDeliveryThe specified user is not local, but the receiving SMTP service accepted the message and attempted to deliver it. This status code is defined in RFC 1123, which is available at http://www.ietf.org.
ClientNotPermittedThe client was not authenticated or is not allowed to send mail using the specified SMTP host.
CommandNotImplementedThe SMTP service does not implement the specified command.
CommandParameterNotImplementedThe SMTP service does not implement the specified command parameter.
CommandUnrecognizedThe SMTP service does not recognize the specified command.
ExceededStorageAllocationThe message is too large to be stored in the destination mailbox.
GeneralFailureThe transaction could not occur. You receive this error when the specified SMTP host cannot be found.
HelpMessageA Help message was returned by the service.
InsufficientStorageThe SMTP service does not have sufficient storage to complete the request.
LocalErrorInProcessingThe SMTP service cannot complete the request. This error can occur if the client's IP address cannot be resolved (that is, a reverse lookup failed). You can also receive this error if the client domain has been identified as an open relay or source for unsolicited e-mail (spam). For details, see RFC 2505, which is available at http://www.ietf.org.
MailboxBusyThe destination mailbox is in use.
MailboxNameNotAllowedThe syntax used to specify the destination mailbox is incorrect.
MailboxUnavailableThe destination mailbox was not found or could not be accessed.
MustIssueStartTlsFirstThe SMTP server is configured to accept only TLS connections, and the SMTP client is attempting to connect by using a non-TLS connection. The solution is for the user to set EnableSsl=true on the SMTP Client.
OkThe email was successfully sent to the SMTP service.
ServiceClosingTransmissionChannelThe SMTP service is closing the transmission channel.
ServiceNotAvailableThe SMTP service is not available; the server is closing the transmission channel.
ServiceReadyThe SMTP service is ready.
StartMailInputThe SMTP service is ready to receive the e-mail content.
SyntaxErrorThe syntax used to specify a command or parameter is incorrect.
SystemStatusA system status or system Help reply.
TransactionFailedThe transaction failed.
UserNotLocalTryAlternatePathThe user mailbox is not located on the receiving server. You should resend using the supplied address information.
UserNotLocalWillForwardThe user mailbox is not located on the receiving server; the server forwards the e-mail.

The values in the SmtpStatusCode enumeration specify reply status values sent by a Simple Mail Transfer Protocol (SMTP) server. The SmtpException and SmtpFailedRecipientsException classes contain StatusCode properties that return SmtpStatusCode values.

SMTP is defined in RFC 2821 available at http://www.ietf.org.

The following code example displays an error message to the console when an SmtpException is thrown.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft