SmtpFailedRecipientException Constructors

Definition

Initializes a new instance of the SmtpFailedRecipientException class.

Overloads

SmtpFailedRecipientException()

Initializes an empty instance of the SmtpFailedRecipientException class.

SmtpFailedRecipientException(String)

Initializes a new instance of the SmtpFailedRecipientException class with the specified error message.

SmtpFailedRecipientException(SmtpStatusCode, String)

Initializes a new instance of the SmtpFailedRecipientException class with the specified status code and email address.

SmtpFailedRecipientException(String, Exception)

Initializes a new instance of the SmtpException class with the specified error message and inner exception.

SmtpFailedRecipientException(SmtpStatusCode, String, String)

Initializes a new instance of the SmtpFailedRecipientException class with the specified status code, email address, and server response.

SmtpFailedRecipientException(String, String, Exception)

Initializes a new instance of the SmtpException class with the specified error message, email address, and inner exception.

SmtpFailedRecipientException(SerializationInfo, StreamingContext)

Initializes a new instance of the SmtpFailedRecipientException class from the specified instances of the SerializationInfo and StreamingContext classes.

SmtpFailedRecipientException()

Initializes an empty instance of the SmtpFailedRecipientException class.

public:
 SmtpFailedRecipientException();
public SmtpFailedRecipientException ();
Public Sub New ()

Applies to

SmtpFailedRecipientException(String)

Initializes a new instance of the SmtpFailedRecipientException class with the specified error message.

public:
 SmtpFailedRecipientException(System::String ^ message);
public SmtpFailedRecipientException (string? message);
public SmtpFailedRecipientException (string message);
new System.Net.Mail.SmtpFailedRecipientException : string -> System.Net.Mail.SmtpFailedRecipientException
Public Sub New (message As String)

Parameters

message
String

A String that contains the error message.

Remarks

This constructor uses the message parameter to initialize the Message property.

Applies to

SmtpFailedRecipientException(SmtpStatusCode, String)

Initializes a new instance of the SmtpFailedRecipientException class with the specified status code and email address.

public:
 SmtpFailedRecipientException(System::Net::Mail::SmtpStatusCode statusCode, System::String ^ failedRecipient);
public SmtpFailedRecipientException (System.Net.Mail.SmtpStatusCode statusCode, string? failedRecipient);
public SmtpFailedRecipientException (System.Net.Mail.SmtpStatusCode statusCode, string failedRecipient);
new System.Net.Mail.SmtpFailedRecipientException : System.Net.Mail.SmtpStatusCode * string -> System.Net.Mail.SmtpFailedRecipientException
Public Sub New (statusCode As SmtpStatusCode, failedRecipient As String)

Parameters

statusCode
SmtpStatusCode

An SmtpStatusCode value.

failedRecipient
String

A String that contains the email address.

Remarks

This constructor uses the statusCode parameter to initialize the StatusCode property and uses the failedRecipient parameter to initialize the FailedRecipient property.

Applies to

SmtpFailedRecipientException(String, Exception)

Initializes a new instance of the SmtpException class with the specified error message and inner exception.

public:
 SmtpFailedRecipientException(System::String ^ message, Exception ^ innerException);
public SmtpFailedRecipientException (string? message, Exception? innerException);
public SmtpFailedRecipientException (string message, Exception innerException);
new System.Net.Mail.SmtpFailedRecipientException : string * Exception -> System.Net.Mail.SmtpFailedRecipientException
Public Sub New (message As String, innerException As Exception)

Parameters

message
String

A String that describes the error that occurred.

innerException
Exception

The exception that is the cause of the current exception.

Applies to

SmtpFailedRecipientException(SmtpStatusCode, String, String)

Initializes a new instance of the SmtpFailedRecipientException class with the specified status code, email address, and server response.

public:
 SmtpFailedRecipientException(System::Net::Mail::SmtpStatusCode statusCode, System::String ^ failedRecipient, System::String ^ serverResponse);
public SmtpFailedRecipientException (System.Net.Mail.SmtpStatusCode statusCode, string? failedRecipient, string? serverResponse);
public SmtpFailedRecipientException (System.Net.Mail.SmtpStatusCode statusCode, string failedRecipient, string serverResponse);
new System.Net.Mail.SmtpFailedRecipientException : System.Net.Mail.SmtpStatusCode * string * string -> System.Net.Mail.SmtpFailedRecipientException
Public Sub New (statusCode As SmtpStatusCode, failedRecipient As String, serverResponse As String)

Parameters

statusCode
SmtpStatusCode

An SmtpStatusCode value.

failedRecipient
String

A String that contains the email address.

serverResponse
String

A String that contains the server response.

Remarks

This constructor uses the statusCode parameter to initialize the StatusCode property and uses the failedRecipient parameter to initialize the FailedRecipient property.

Applies to

SmtpFailedRecipientException(String, String, Exception)

Initializes a new instance of the SmtpException class with the specified error message, email address, and inner exception.

public:
 SmtpFailedRecipientException(System::String ^ message, System::String ^ failedRecipient, Exception ^ innerException);
public SmtpFailedRecipientException (string? message, string? failedRecipient, Exception? innerException);
public SmtpFailedRecipientException (string message, string failedRecipient, Exception innerException);
new System.Net.Mail.SmtpFailedRecipientException : string * string * Exception -> System.Net.Mail.SmtpFailedRecipientException
Public Sub New (message As String, failedRecipient As String, innerException As Exception)

Parameters

message
String

A String that describes the error that occurred.

failedRecipient
String

A String that contains the email address.

innerException
Exception

The exception that is the cause of the current exception.

Applies to

SmtpFailedRecipientException(SerializationInfo, StreamingContext)

Initializes a new instance of the SmtpFailedRecipientException class from the specified instances of the SerializationInfo and StreamingContext classes.

protected:
 SmtpFailedRecipientException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected:
 SmtpFailedRecipientException(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
protected SmtpFailedRecipientException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected SmtpFailedRecipientException (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
new System.Net.Mail.SmtpFailedRecipientException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.Mail.SmtpFailedRecipientException
new System.Net.Mail.SmtpFailedRecipientException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.Mail.SmtpFailedRecipientException
Protected Sub New (info As SerializationInfo, context As StreamingContext)
Protected Sub New (serializationInfo As SerializationInfo, streamingContext As StreamingContext)

Parameters

infoserializationInfo
SerializationInfo

A SerializationInfo that contains the information required to serialize the new SmtpFailedRecipientException.

contextstreamingContext
StreamingContext

A StreamingContext that contains the source and destination of the serialized stream that is associated with the new instance.

Remarks

This constructor implements the ISerializable interface for the SmtpFailedRecipientException class.

Applies to