com.jniwrapper.win32.mapi
Class MapiException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.jniwrapper.win32.mapi.MapiException
All Implemented Interfaces:
java.io.Serializable

public class MapiException
extends java.lang.Exception

This class represents all the exceptions thrown by the native MAPISendMail function. MAPISendMail function in MSDN Library

See Also:
Serialized Form

Field Summary
static int MAPI_E_ACCESS_DENIED
          Access denied.
static int MAPI_E_AMBIG_RECIP
          A recipient matched more than one of the recipient descriptor structures and MAPI_DIALOG was not set.
static int MAPI_E_AMBIGUOUS_RECIPIENT
          A recipient matched more than one of the recipient descriptor structures and MAPI_DIALOG was not set.
static int MAPI_E_ATTACHMENT_NOT_FOUND
          The specified attachment was not found.
static int MAPI_E_ATTACHMENT_OPEN_FAILURE
          The specified attachment could not be opened.
static int MAPI_E_BAD_RECIPTYPE
          The type of a recipient was not MAPI_TO, MAPI_CC, or MAPI_BCC.
static int MAPI_E_FAILURE
          One or more unspecified errors occurred.
static int MAPI_E_INSUFFICIENT_MEMORY
          There was insufficient memory to proceed.
static int MAPI_E_INVALID_RECIPS
          One or more recipients were invalid or did not resolve to any address.
static int MAPI_E_LOGIN_FAILURE
          There was no default logon, and the user failed to log on successfully when the logon dialog box was displayed.
static int MAPI_E_LOGON_FAILURE
          There was no default logon, and the user failed to log on successfully when the logon dialog box was displayed.
static int MAPI_E_NOT_SUPPORTED
          Not supported.
static int MAPI_E_TEXT_TOO_LARGE
          The text in the message was too large.
static int MAPI_E_TOO_MANY_FILES
          There were too many file attachments.
static int MAPI_E_TOO_MANY_RECIPIENTS
          There were too many recipients.
static int MAPI_E_UNKNOWN_RECIPIENT
          A recipient did not appear in the address list.
static int MAPI_E_USER_ABORT
          The user canceled one of the dialog boxes.
static int SUCCESS
          The call succeeded and the message was sent.
 
Constructor Summary
MapiException(int errorCode)
          Creates new instance of the MapiException.
MapiException(java.lang.String message)
          Creates new instance of the MapiException.
 
Method Summary
 int getErrorCode()
          Returns the message error code.
static java.lang.String getMessage(int errorCode)
          Returns the message that corresponds to the specified error code.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SUCCESS

public static final int SUCCESS
The call succeeded and the message was sent.

See Also:
Constant Field Values

MAPI_E_USER_ABORT

public static final int MAPI_E_USER_ABORT
The user canceled one of the dialog boxes. No message was sent.

See Also:
Constant Field Values

MAPI_E_FAILURE

public static final int MAPI_E_FAILURE
One or more unspecified errors occurred. No message was sent.

See Also:
Constant Field Values

MAPI_E_LOGON_FAILURE

public static final int MAPI_E_LOGON_FAILURE
There was no default logon, and the user failed to log on successfully when the logon dialog box was displayed. No message was sent.

See Also:
Constant Field Values

MAPI_E_LOGIN_FAILURE

public static final int MAPI_E_LOGIN_FAILURE
There was no default logon, and the user failed to log on successfully when the logon dialog box was displayed. No message was sent.

See Also:
Constant Field Values

MAPI_E_INSUFFICIENT_MEMORY

public static final int MAPI_E_INSUFFICIENT_MEMORY
There was insufficient memory to proceed. No message was sent.

See Also:
Constant Field Values

MAPI_E_ACCESS_DENIED

public static final int MAPI_E_ACCESS_DENIED
Access denied.

See Also:
Constant Field Values

MAPI_E_TOO_MANY_FILES

public static final int MAPI_E_TOO_MANY_FILES
There were too many file attachments. No message was sent.

See Also:
Constant Field Values

MAPI_E_TOO_MANY_RECIPIENTS

public static final int MAPI_E_TOO_MANY_RECIPIENTS
There were too many recipients. No message was sent.

See Also:
Constant Field Values

MAPI_E_ATTACHMENT_NOT_FOUND

public static final int MAPI_E_ATTACHMENT_NOT_FOUND
The specified attachment was not found. No message was sent.

See Also:
Constant Field Values

MAPI_E_ATTACHMENT_OPEN_FAILURE

public static final int MAPI_E_ATTACHMENT_OPEN_FAILURE
The specified attachment could not be opened. No message was sent.

See Also:
Constant Field Values

MAPI_E_UNKNOWN_RECIPIENT

public static final int MAPI_E_UNKNOWN_RECIPIENT
A recipient did not appear in the address list. No message was sent.

See Also:
Constant Field Values

MAPI_E_BAD_RECIPTYPE

public static final int MAPI_E_BAD_RECIPTYPE
The type of a recipient was not MAPI_TO, MAPI_CC, or MAPI_BCC. No message was sent.

See Also:
Constant Field Values

MAPI_E_TEXT_TOO_LARGE

public static final int MAPI_E_TEXT_TOO_LARGE
The text in the message was too large. No message was sent.

See Also:
Constant Field Values

MAPI_E_AMBIGUOUS_RECIPIENT

public static final int MAPI_E_AMBIGUOUS_RECIPIENT
A recipient matched more than one of the recipient descriptor structures and MAPI_DIALOG was not set. No message was sent.

See Also:
Constant Field Values

MAPI_E_AMBIG_RECIP

public static final int MAPI_E_AMBIG_RECIP
A recipient matched more than one of the recipient descriptor structures and MAPI_DIALOG was not set. No message was sent.

See Also:
Constant Field Values

MAPI_E_INVALID_RECIPS

public static final int MAPI_E_INVALID_RECIPS
One or more recipients were invalid or did not resolve to any address.

See Also:
Constant Field Values

MAPI_E_NOT_SUPPORTED

public static final int MAPI_E_NOT_SUPPORTED
Not supported.

See Also:
Constant Field Values
Constructor Detail

MapiException

public MapiException(int errorCode)
Creates new instance of the MapiException.

Parameters:
errorCode - The message error code.

MapiException

public MapiException(java.lang.String message)
Creates new instance of the MapiException. The message error code will be set to -1.

Parameters:
message - The message text.
Method Detail

getErrorCode

public int getErrorCode()
Returns the message error code.

Returns:
The message error code.

getMessage

public static java.lang.String getMessage(int errorCode)
Returns the message that corresponds to the specified error code.

Parameters:
errorCode - The message error code.
Returns:
Message text. If message error code passes in by the errorCode parameter wasn't found, null will be returned.