Class SmtpException

SmtpException class

The exception that is thrown when an SMTP client cannot complete an operation.

public class SmtpException : AsposeException

Constructors

NameDescription
SmtpException()Initializes a new instance of the SmtpException class.
SmtpException(SmtpStatusCode)Initializes a new instance of the SmtpException class with the status code returned by the server.
SmtpException(string)Initializes a new instance of the SmtpException class with the specified error message.
SmtpException(SmtpStatusCode, string)Initializes a new instance of the SmtpException class with the status code returned by the server and an error message.
SmtpException(string, Exception)Initializes a new instance of the SmtpException class with the specified error message and a reference to the exception that caused it.
SmtpException(string, MailMessage)Initializes a new instance of the SmtpException class for a message that could not be sent.
SmtpException(string, SendMessagesResult)Initializes a new instance of the SmtpException class with an error message and the result of sending several messages.
SmtpException(string, Exception, MailMessage)Initializes a new instance of the SmtpException class for a message that could not be sent.

Properties

NameDescription
ErrorDetails { get; }Gets additional information about the error, if the operation provides any.
override Message { get; }Gets the message that describes the error.
OperationDetails { get; }Gets the result of the operation: the messages that were sent and the messages that failed, with their errors.
StatusCode { get; set; }Gets or sets the SMTP status code returned by the server.

Methods

NameDescription
override ToString()Returns the type, the message and the stack trace of the exception.

Remarks

When several messages are sent at once, OperationDetails tells which messages were sent and which failed.

See Also