GetLastError Method

Get latest error code while sending email.

Visual C++: HRESULT GetLastError(long* pVal)
Visual Basic: GetLastError() As Long

Return Value

Value Meaning
0 Error with connecting server.
1 Error with sending HELO/EHLO.
2 Error with user authentication.
3 Error with sending sender.
4 Error with sending recipients.
5 Error with sending data.
6 Error with SMTP reset.
7 Error with Dns lookup.


If there is no error, the return value is -1. This method is designed for synchronous operating mode.

See Also

GetLastErrDescription Method