Share via


Mapi Class

The Mapi class enables email to be sent, received, and managed in most major mail systems, such as Microsoft Exchange–based systems, Microsoft Outlook Express, and Lotus CCMail.

Syntax

class Mapi extends Object

Run On

Called

Methods

  Method Description
Gg911895.pubmethod(en-us,AX.60).gif cancelTimeOut Cancels a previous method call to the setTimeOut method. (Inherited from Object.)
Gg911895.pubmethod(en-us,AX.60).gif deleteMail Removes the specified message from the message store.
Gg911895.pubmethod(en-us,AX.60).gif equal Determines whether the specified object is equal to the current one. (Inherited from Object.)
Gg911895.pubmethod(en-us,AX.60).gif finalize
Gg911895.pubmethod(en-us,AX.60).gif findNext Finds the first or next message in the message store.
Gg911895.pubmethod(en-us,AX.60).gif getTimeOutTimerHandle Returns the timer handle for the object. (Inherited from Object.)
Gg911895.pubmethod(en-us,AX.60).gif handle Retrieves the handle of the class of the object. (Inherited from Object.)
Gg911895.pubmethod(en-us,AX.60).gif logoff Lets you log off the mail system.
Gg911895.pubmethod(en-us,AX.60).gif logon Logs on to the mail system by using the specified profile and password.
Gg911895.pubmethod(en-us,AX.60).gif new Initializes an instance of the Mapi class. (Overrides the new Method.)
Gg911895.pubmethod(en-us,AX.60).gif notify Releases the hold on an object that has called the wait method on this object. (Inherited from Object.)
Gg911895.pubmethod(en-us,AX.60).gif notifyAll Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.)
Gg911895.pubmethod(en-us,AX.60).gif objectOnServer Determines whether the object is on a server. (Inherited from Object.)
Gg911895.pubmethod(en-us,AX.60).gif owner Returns the instance that owns the object. (Inherited from Object.)
Gg911895.pubmethod(en-us,AX.60).gif readMail Retrieves a message from the message store.
Gg911895.pubmethod(en-us,AX.60).gif resolveName Transforms the message recipient's name, as entered by a user, to an unambiguous address list entry.
Gg911895.pubmethod(en-us,AX.60).gif saveMail Saves a message to the message store.
Gg911895.pubmethod(en-us,AX.60).gif sendMail Sends a message to the specified recipients.
Gg911895.pubmethod(en-us,AX.60).gif setTimeOut Sets up the scheduled execution of a specified method. (Inherited from Object.)
Gg911895.pubmethod(en-us,AX.60).gif status Retrieves the status of the last Mapi operation.
Gg911895.pubmethod(en-us,AX.60).gif toString Returns a string that represents the current object. (Inherited from Object.)
Gg911895.pubmethod(en-us,AX.60).gif usageCount Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.)
Gg911895.pubmethod(en-us,AX.60).gif wait Pauses a process. (Inherited from Object.)
Gg911895.pubmethod(en-us,AX.60).gif xml Returns an XML string that represents the current object. (Inherited from Object.)

Top

Remarks

Together with the other Mapi classes, MapiMessage, MapiRecipDesc, and MapiFileDesc, this class lets you specify multiple recipients, file attachments, message text, and a subject.

The easiest approach is to set up a working mail client on the machine, and make sure that this works correctly order by sending and receiving a few email messages.

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

Examples

The following example shows how to send an email message by using this class.

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(); 
}

Inheritance Hierarchy

Object Class
  Mapi Class