Export (0) Print
Expand All

Mapi Class

The Mapi class enables sending, receiving, and managing mail in most major mail systems, including Microsoft Exchange based systems, Microsoft Outlook Express, Lotus CCMail, and others.


class Mapi extends Object

Called

Method

Description

cancelTimeOut

Cancels a previous method call to the Object.setTimeOut Method. (Inherited from Object.)

deleteMail

Removes the specified message from the message store.

equal

Determines whether the specified object is equal to the current one. (Inherited from Object.)

finalize

findNext

Finds the first or next mail in the message store.

getTimeOutTimerHandle

Returns the timer handle for the object. (Inherited from Object.)

handle

Retrieves the handle of the class of the object. (Inherited from Object.)

logoff

Allows you to log off the mail system.

logon

Logs on to the mail system using the specified profile and password.

new

Overridden. Initializes a new instance of the Mapi class.

notify

Releases the hold on an object that has called a wait method on this object. (Inherited from Object.)

notifyAll

Releases a lock on the object that was issued by a wait method on this object. (Inherited from Object.)

objectOnServer

Determines whether the object is on a server. (Inherited from Object.)

owner

Returns the instance that owns the object. (Inherited from Object.)

readMail

Retrieves a message from the message store.

resolveName

Transforms a message recipient's name, as entered by a user, to an unambiguous address list entry.

saveMail

Saves a mail message to the message store.

sendMail

Sends a MapiMessage to specified recipients.

setTimeOut

Sets up the scheduled execution of a specified method. (Inherited from Object.)

status

Retrieves the status of the last Mapi operation.

toString

Returns a string that represents the current object. (Inherited from Object.)

usageCount

Returns the current number of references (the value of the reference counter) that the object has. (Inherited from Object.)

wait

Pauses a process. (Inherited from Object.)

xml

Returns an XML string that represents the current object. (Inherited from Object.)

Together with the other Mapi classes, MapiMessage Class, MapiRecipDesc Class, and MapiFileDesc Class, this class allows you to specify multiple recipients, file attachments, and mail text and subject.

The easiest approach is to setup a working mail client on the machine and ensure that this is in working order by sending and receiving a few mails.

Flags for the Mapi methods are located in the Mapi macro. You include this macro in code where you use the Mapi classes with the statement #MAPI.

static void example()
{
    #Mapi
    Mapi m = new Mapi();
    MapiMessage msg = new MapiMessage();
    MapiRecipDesc recip = new MapiRecipDesc();
 
    // Set up the recipient.
    recip.Name("someone");
    recip.RecipClass(#MAPI_TO);
    msg.setRecipNo(1,recip);
 
    // Log on using default profile.
    m.Logon("","",#MAPI_USE_DEFAULT);

    // Send the mail, and allow the user to modify the
    // Subject, Text and Recipients in the Send Mail Dialog.
    m.SendMail(msg,#MAPI_DIALOG);
 
    // Log off.
    m.Logoff();
}

Community Additions

ADD
Show:
© 2014 Microsoft