GetErrorDescription Method
Previous  Top  Next


GetErrorDescription
method obtains error description for a message that was queued for sending using SendAsync method and failed to be sent.

Syntax

[Visual Basic]


Function
 GetErrorDescription(numMessageNumber As LongAs String

Example:

Dim
 strError As String
strError = objSmtpMail.GetErrorDescription(numMessageNumber)

[VBScript]


Function
 GetErrorDescription(numMessageNumber)

Example:

Dim
 strError
strError = objSmtpMail.GetErrorDescription(numMessageNumber)

[C#]


string
 GetErrorDescription(int numMessageNumber);

Example:

string
 strError = objSmtpMail.GetErrorDescription(numMessageNumber);

[C++]


HRESULT GetErrorDescription(LONG numMessageNumber, BSTR* pstrError);

Example:

_bstr_t strError = spSmtpMail->GetErrorDescription(numMessageNumber);


Parameters

numMessageNumber [in]
Message number returned from the SendAsync method.

Return value

Returns extended error information if the message failed to be sent, empty string otherwise.

Remarks

SendAsync method places a message into a message queue and returns message number which identifies the message. If message failed to be sent, status of the message becomes MailStatusFailed and GetErrorDescription method can be used to obtain error description.