Contents
OBMAPI class library      Information Guide

The OBMAPI class library gives you access to services in Microsoft Mail. The APIs work with Windows 3.1 clients, and with Win16 and Win32 clients under Windows 95 and Windows NT.

Features

Examples


OBMAPI features

The OBMAPI class library gives you access to the message system using features in Microsoft Mail. You can use it to send and receive e-mail, and access address books and message stores. OBMAPI gives you the same look and feel as Microsoft Mail, because it calls the same programs from the MAPI dynamic link library.

OBMAPI APIs

Many of these APIs contain built-in user interface capabilities:

OBMAPI/Address A Message

OBMAPI/Delete A Message

OBMAPI/Display Address List Entry

OBMAPI/End Message Session

OBMAPI/Free Memory

OBMAPI/Read A Message

OBMAPI/Resolve Name

OBMAPI/Return A Message Identifier

OBMAPI/Save A Message

OBMAPI/Send Documents

OBMAPI/Send Mail

OBMAPI/Start Message Session

Other objects let you build mail messages and addresses without using a user interface:

OBMAPI/Build Address

OBMAPI/Build Message


OBMAPI examples

Send mail

Send documents

Select recipients and send mail

Deliver mail and save messages

Resolve name and display address list entry


MAPI

(Messaging Application Programming Interface) A messaging architecture and a client interface component. MAPI enables applications to interact with messaging systems across hardware platforms.


Message system

The message system is the backbone for all e-mail and network communication on Windows. The message system is a collection of Windows operating system objects and dynamic link libraries.

The MAPI dynamic link library is a central component in the message system. This library contains programs that serve as the glue between message stores, address books, service providers, the MAPI client, and end-user applications.

Message stores are files containing e-mail messages. Address books contain user specified e-mail address information. Service providers are software applications that are the gateways to and from the message system. Microsoft Mail, Microsoft Fax, and Microsoft Network are examples of service providers.

A MAPI client is the principal user interface for all e-mail and network communication. In Windows 95, the Microsoft Exchange In-Box is an example of a MAPI client.


Message session

A message session is a contract between you and the message system. Once established, the contract identifies who you are, your address, and what you can or cannot do.

Applications must start a message session before sending or receiving mail, or using any other message services.

You can create a new message session or you can share an existing one. Or you can have a temporary session that lasts for the duration of a single API. When a share attempt is made, an error code is returned when no session exists for sharing.

•	You can call Start Message Session explicitly to get a session handle. Using the session handle, you can call other messaging system APIs. When you start a session in this manner, it remains open until you release it by calling End Message Session.

•	You can also start a message session by calling class library objects with the session handle set to 0. The API creates a temporary session, processes, and automatically closes the session upon exit.


Memory management

When you build a MAPI object, like a message or an address, information is copied into a space in computer memory. Unless you free the space after you've used it, your computer can think the space is still in use.

Two of the OBMAPI APIs, Send Mail and Send Documents, automatically free memory when they return. If you call either of these APIs, you don't need to free allocated memory. If you do not use these APIs, you are responsible for freeing allocated memory, using one of the calls in the following table:

When you use:	Use:
Address A Message	Free Memory
Resolve Name	Free Memory
Read A Message	Free Memory
Build Address	Free Address
Build Message	Free Message


Examples

Select recipients and send message

Deliver mail and save messages

Resolve name and display address list entry


Examples

Select recipients and send message

Send mail


Address a message
Address A Message     Example     User Interface

Source code syntax:  Return code = ObMapi::Address( Parameter list );

Description

This object displays a standard address-list dialog box showing an initial set of zero or more addressee's. You can chose new entries to add to the set or make changes to existing entries.

You can set dialog box characteristics to read only. Output from this object, a reference to selected addressees, is passed into other class library objects.

Address A Message has the following parameters:

Parameter list	Attributes

Session Handle	Input,	an explicit message session handle, or 0

Log On Required 	Input,	display dialog box for log on information

Create New Session	Input,	create new session, or acquire a shared session

Caption On Dialog Box	Input,	caption to place in the dialog box title

Number Of Edit Controls	Input,	number of edit control buttons, or 0

Edit Control Label	Input,	caption to place in an edit control button

Initial Number Of Recipients	Input,	number of initial addressees in the list. or 0

Initial Recipient List Handle	Input,	reference to an initial list of addressees, or 0

Number Of Recipients	Output,	number of addressees selected

Selected Recipients Handle	Output,	reference to a list of selected addressees

Useful hints

•	Number Of Edit Controls determines which edit control buttons display on the dialog box. When set to 4, controls displayed are <To>, <Cc>, and <Bcc>. Values 1, 2,or 3 display 1, 2, or 3 edit control buttons.

•	You can label a single edit control button; however, labels are ignored when Number Of Edit Controls is greater than 1.

•	Selected Recipients Handle points to a structure containing information about the selected addressees information. You must free memory allocated for this structure before the application ends, using OBMAPI/Free Memory.


Address A Message

Address A Message contains the following user interface:


Free message
Free Message     Example

Source code syntax:  Return code = ObMapi::FreeMapiMessage( Parameter list );

Description

This object frees a mail message from computer memory. Use this object to free memory after using OBMAPI/Build Message.

Free Message has the following parameters:

Parameter list	Attributes

Message Handle	Input,	a reference to a message


Build message
Build Message     Example

Source code syntax:  Return code = ObMapi::BuildMapiMessage( Parameter list );

Description

This object lets you build a message without using a dialog box. The reference to the message, output by this object, can be input to other class library objects.

Build Message has the following parameters:

Parameter list	Attributes

Subject	Input, 	message subject

Message Text	Input,	message text

Receipt Requested	Input, 	notify originator upon receipt

Originator Handle	Input,	reference to originator address, or 0

Number Of Recipients	Input,	number of addressee's in list

Recipient Handle	Input,	reference to addressee list

Number File Attachments	Input,	a value set to 0

File Attachments Handle	Input,	a value set to 0

Message Handle	Output,	a reference to the message

Useful hints

•	Set Receipt Requested to True if you want notification of receipt; otherwise, set it to False.

•	See OBMAPI/Address A Message for ways to get an originator handle and a recipient list handle.

•	Before you end your application, you must free the memory allocated to the message handle, originator handle, and recipient list handle, by calling OBMAPI/Free Message.


Build Address

Source code syntax:  Return code = ObMapi::BuildAddressStructure( Parameter list );

Description

This object lets you build and address a message without using a dialog box, and is a good way to build a reference to an addressee not known to your local messaging system. Output from this object, a reference to the address, is passed into other class library objects.

Build Address has the following parameters:

Parameter list	Attributes

Addressee Class	Input,	a value or 0,1,2, or 3

Name	Input,	addressee name

Address	Input,	e-mail address

Address Handle	Output,	a reference the addressee

Useful hints

•	Addressee Class 0 means <FROM>, 1 means <TO>, 2, means <CC>, and 3 means <BCC>.

•	The format of the address is [address type]:[e-mail address]. For outbound messages you can specify any valid e-mail address. You can create a message for an individual not in your address book (a custom receipt).

•	Examples of [address type] are: COMPUSERV, FAX, SMTP, MSN.

•	An address for the number 800-123-4567 would be FAX:1-800-123-4567.

•	A service provider must be installed for each of the above services before you can send messages with address types shown.

•	Before you end your application, you must free the memory allocated to the address handle by calling OBMAPI/Free Address.


Free Address

Source code syntax:  Return code = ObMapi::FreeMapiRecipDesc( Parameter list );

Description

This object frees a mail address from computer memory. Use this object to free memory after using OBMAPI/Build Address.

Free Address has the following parameters:

Parameter list	Attributes

Address Handle	Input,	a reference to an address

Number Of Addresses	Input,	the number of addresses to free


Send mail
Send Mail     Examples     User Interface

Source code syntax:  Return code = ObMapi::SendMail ( Parameter-list );

Description

This object sends a mail message with or without a user interface. Your mail profile must be configured to open the default service providers without requiring any user interaction.

Send Mail has the following parameters:

Parameter list	Attributes

Session Handle	Input, 	an explicit message session handle, or 0

Parent Window Handle	Input, 	a parent window handle, or 0

Message Handle	Input, 	reference to a mail message, or 0

Log On Required 	Input, 	display dialog box for log on information

Create New Session 	Input, 	create new session , or acquire a shared session

Display Dialog Box	Input, 	display the send mail dialog box

Useful hints

•	Set Parent Window Handle to 0 to block the underlying panel until Send Mail completes.

•	Set the message handle to 0 when you want to send a message using a dialog box; otherwise use a message handle. See OBMAPI/Build Message for more information.

•	If the object creates an implicit message session, and the profile requires a password, then Log On Required must be True, or Send Mail will fail.


Send Mail

Send Mail contains the following user interface:


Send documents
Send Documents     Example     User Interface

Source code syntax:  Return code = ObMapi::SendDocument( Parameter list );

Description

Send Documents sends a mail message with file attachments and a cover note. Less commonly used, this API has a dialog box similar to OBMAPI/Send Mail.

Send Documents has the following parameters:

Parameter list	Attributes

Parent Window Handle 	Input, 	reference to the parent window, or 0

Delimiter Character	Input, 	delimiter character between full path names, and file names

Full Path Names	Input, 	full path names including drive letters

File Names	Input, 	file names added to the message as attachments

Useful hints

•	Set Parent Window Handle to 0 block the underlying panel until Send Documents completes.

•	You can send one or more file attachments, by specifying the full path name and file name of each attachment. The full path name tells the API where to find the file, and the file name displays in the mail message below the icon of the attached file. If Full Path Names is null or blank, a dialog box is displayed with no attached files. An example of a valid full path name is:

D:\OBASE.HLP

An example of a file name is:

OBASE.HLP

•	When you have more than one file attachment, you concatenate the names, separated by the specified Delimiter Character, set to semicolon by default. For example, a list of path names is:

D:\OBASE.HLP;D:\OBASE\HLP; D:\OBJECTS.HLP; D:\OBMAPI.HLP

An example of multiple file names, using the default delimiter of semicolon, is:

OBASE.HLP;OBJECTS.HLP;OBMAPI.HLP

•	Use the default delimiter character (semicolon), or select a character not used by operating system file names. Do not use a space as the delimiter. The delimiter character is mandatory; it must be specified, even if you send a single attachment.


Send Documents

Send Documents has the following user interface:


Save a message
Save A Message     Example

Source code syntax:  Return code = ObMapi::SaveMail( Parameter list );

Description

This object saves a mail message, optionally replacing elements of an existing message. Use OBMAPI/Return A Message Identifier to verify that the message is the one you want saved.

Save A Message has the following parameters:

Parameter list	Attributes

Session Handle	Input,	either an explicit session handle, or 0

Parent Window Handle	Input,	reference to the parent window, or 0

Message Handle	Input,	a reference to a message to be saved

Log On Required 	Input,	display dialog box for log on information

Create New Session	Input,	create new session, or acquire a shared session

Long Message ID Allowed	Input,	allow message id's as long as 512 characters

Message ID	Both	message identifier to be replaced by the save, or null

Useful hints

•	Set Parent Window Handle to 0 to block the underlying panel if a dialog box is displayed by this object.

•	The elements specified by Message ID are replaced by the elements specified by Message Handle. If Message ID is null or empty, a new message is created.

•	All replaced messages are saved in their appropriate folders. New messages are saved in the folder for incoming messages of that class.


Resolve name
Resolve Name     Example     User Interface

Source code syntax:  Return code = ObMapi::ResolveName( Parameter list );

Description

This object matches an input name against names in the default address book. If a name resolves into a single match, then a reference to the matching addressee is returned.

Resolve Name has the following parameters:

Parameter list	Attributes

Session Handle	Input,	either an explicit message session handle, or 0

Parent Window Handle	Input,	reference to the parent window, or 0

Name	Input,	name to match against the address book

Read Only Dialog Box	Input,	allow read only dialog box

Display Dialog Box	Input,	display dialog box to resolve ambiguities

Log On Required	Input,	display dialog box for log on information

Create New Session	Input,	create new session, or acquire a shared session

Recipient Handle	Output, 	a reference to an addressee

Useful hints

•	Set Parent Window Handle to 0 to block the underlying panel if a dialog box is displayed by this object.

•	If a single match is not found, and Display Dialog Box is set to True, then a dialog box displays to resolve the name; otherwise no dialog box is displayed and Return Code is set to *Abnormal.

•	Recipient Handle points to a structure if the resolution results in a match. This structure contains the resolved name and related information. Before the application ends, you must free memory for this structure by calling OBMAPI/Free Memory.


Resolve Name

Resolve Name displays the following dialog box when more than one name in the address list matches:


Read a message
Read A Message     Example

Source code syntax:  Return code = ObMapi::ReadMail( Parameter list );

Description

This object returns one mail message, breaking the message contents into the same components used in Send Mail. Read A Message fills a block of memory, referred to by a message handle, containing message elements such as subject, message class, delivery time, and sender.

Read A Message has the following parameters:

Parameter list	Attributes

Session Handle	Input,	an explicit message session handle, or 0

Parent Window Handle 	Input,	reference to the parent window, or 0

Message ID 	Input,	message identifier of the message to read

Message Text To File	Input,	save the message to a file for use as an attachment

Read Header Only	Input,	read only the header of the message or the body text too

Mark Message As Read	Input,	mark the message as read after opening

Suppress Attachments	Input,	do not include attachments with the message body

Message handle	Output,	reference to a mail message

Useful hints

•	Set Parent Window Handle to 0 to block the underlying panel until Read A Message completes.

•	File attachments are saved to temporary files, and the names updated within the message structure. All components of the message are copied from the message before Read A Message closes, so later changes to attachments, and addressees do not affect the content of the message.

•	Mail messages are read to a space in memory referred to by the message handle. You can free the space using OBMAPI/Free Memory.


Start message session
Start Message Session     Examples     User Interface

Source code syntax:  Return code = ObMapi::Logon ( Parameter List );

Description

This source code object starts a message session. It loads your message store and address book, and returns a session handle to pass to other OBMAPI class library objects.

Start Message Session has the following parameters:

Parameter List	Attributes

Parent Window Handle	Input,	reference to the parent window, or 0

Profile Name	Input,	profile name to use when logging on

Password	Input,	password to use if required by messaging system

Force Message Download	Input, 	download all messages immediately

Create New Session	Input, 	create new session , or acquire a shared session

Log On Required	Input,	display dialog box for log on information

Prompt For Password	Input,	prompt for password, with no change to profile name

Session Handle	Output,	reference to a message session

Useful hints

•	Set Parent Window Handle to 0 to block the underlying panel until Start Message Session completes.

•	A client program tests for an existing session with a null value for Profile Name and Password, and Log On Required set to False. If there is an existing session, the call succeeds; otherwise the call fails.


Start Message Session

Start Message Session displays the following dialog box:


End message session
End Message Session     Examples

Source code syntax:  Return code = ObMapi::Logoff ( Parameter List );

Description

If you created a message session by calling Start Message Session, then use this object to end that session with the message system before you close your application.

End Message Session has the following parameters:

Parameter list	Attributes

Session Handle	Input,	reference to a message session

Parent Window Handle	Input,	reference to the parent window, or 0


Free memory
Free Memory     Example

Source code syntax:  Return code = ObMapi::FreeBuffer( Parameter list );

Description

This object frees memory allocated by the message system. Use this object with Win32 clients under Windows 95 or Windows NT.

Free Memory has the following parameters:

Parameter list	Attributes

Handle	Input,	a reference to a message, or an address.


Return a message identifier
Return A Message Identifier     Example

Source code syntax:  Return code = ObMapi::FindNext( Parameter list );

Description

This object retrieves the next (or first) message identifier for a type of message. This object can be called repeatedly to retrieve messages by looking in the folder in which new messages of the specified type are delivered.

Return A Message Identifier has the following parameters:

Parameter list	Attributes

Session Handle	Input,	either an explicit message session handle, or 0

Parent Window Handle	Input,	reference to the parent window, or 0

Message Type	Input,	a string identifying message class to search

Message ID Filter	Input,	message identifier to match against

Guarantee FIFO	Input, 	return message id's in order of time received

Long Message ID Allowed	Input,	returned message id's as long as 512 characters

Find Unread Messages	Input, 	return only unread messages

Message ID	Output,	handle to the returned message identifier

Useful hints

•	Set Parent Window Handle to 0 to block the underlying panel if a dialog box is displayed by this object.

•	To find person-to-person messages, set Message Type to blanks.

•	Remember, message identifiers are message system specific, and are valid only for the current session.


Display address list entry
Display Address List Entry     Example     User Interface

Source code syntax:  Return code = ObMapi::Details( Parameter list );

Description

This object displays a dialog box containing the mail address information of an addressee known by the messaging system. The dialog box displays at least the name and address; more information can be shown, depending on the address book provider.

Display Address List Entry has the following parameters:

Parameter list	Attributes

Session Handle	Input,	either an explicit message session handle, or 0

Parent Window Handle	Input,	reference to the parent window, or 0

Recipient Handle	Input, 	a reference to a known addressee

Read Only Dialog Box	Input,	allow read only, or allow update

Log On Required	Input,	display dialog box for log on information

Create New Session	Input,	create new session, or acquire a shared session

Useful hints

•	Set Parent Window Handle to 0 to block the underlying panel until the dialog box closes.

•	Use OBMAPI/Resolve Name to get a reference to a known addressee.


Display Address List Entry

Display Address List Entry contains the following user interface:


Delete A Message

Source code syntax:  Return code = ObMapi::DeleteMail( Parameter list );

Description

This object deletes mail messages.

Parameter list	Attributes

Session Handle 	Input,	must be a non-zero message session handle

Parent Window Handle 	Input, 	either parent window handle, or 0

Message ID	Input,	identifier for the message to be deleted

Useful hints

•	To find the message to be deleted, call OBMAPI/Return A Message Identifier before calling Delete A Message.

•	Remember, message identifiers are valid only during the current session.


Address

A custom address, with the format [addresstype]:[emailaddress]. Examples of valid addresses are FAX:415-555-1212 and SMTP:MJK@SYNON.COM. Inherits from OBMAPI/Mapi Character and has a length of 50.


Addressee Class

The type of recipient of a message. Inherits from OBMAPI/Mapi Character and has a length of 2.

Has the values:

•	TO [image] the primary recipient

•	FROM [image] the sender of the message

•	COPY [image] recipient of a copy of the message

•	BLIND COPY [image] recipient of a blind copy


Address Handle

Points to information about a message address. Inherits from OBMAPI/Handle.


Boolean integer
Mapi Boolean

Inherits from OBJECTS/Integer. Has the values True and False.


Caption On Dialog Box

The caption to use for the address list dialog box. Inherits from OBMAPI/Mapi Text and has a length of 50.


Character
Mapi Character

A character field with a C format of Char. Inherits from OBMAPI/Field.


Create New Session

Specifies whether to create a new session for a call or to share an existing one. Inherits from OBMAPI/Mapi Boolean.

Has the values:

•	True [image] Forces the creation of a new session. This prevents an existing session from being shared.

•	False [image] Shares an existing session, if there is one. Does not create a new temporary session.


Delimiter Character

The character that separates names in the File Names and Full Path Names fields. This should be a character not otherwise used in operating system file names. Inherits from OBMAPI/Mapi Character and has a length of 1.


Display Dialog Box

Specifies whether to display a dialog box to resolve ambiguous recipient names. Inherits from OBMAPI/Mapi Boolean.


Edit Control Label

The label for an edit control in an address list. This field is ignored when Number Of Edit Controls is greater than 1. Inherits from OBMAPI/Mapi Text and has a length of 25.


Field

A field with a text control. Used for inheritance purposes by other class library fields.


File attachements handle
File Attachments Handle

Points to information about the file attachments for a message. Inherits from OBMAPI/Handle.


File Names

A null-terminated list of names of attachment files as they should appear in the message. Names are separated by Delimiter Character. Inherits from OBMAPI/Mapi Character and has a length of 75.


Find Unread Messages

Specifies whether to return only unread messages or all messages. Inherits from OBMAPI/Mapi Boolean.


Force Message Download

Specifies whether to move messages from the server to the user's client workstation. Inherits from OBMAPI/Mapi Boolean.


Full Path Names

A list of full path names, including the drive letter, of attachment files, separated by Delimiter Character. Inherits from OBMAPI/Mapi Character and has a length of 75.


Guarantee FIFO

Specifies whether to return messages in the order in which they were received. Inherits from OBMAPI/Mapi Boolean.


Handle

Points to memory allocated by the messaging system. Inherits from OBMAPI/Mapi Long.


Initial Number Of Recipients

The number of recipients in an address list to display. Inherits from OBMAPI/Mapi Long.


Initial Recipient List Handle

Points to a list of recipient entries to display in an address list. Inherits from OBMAPI/Handle.


Log On Required

Specifies whether to display a dialog box to prompt end-users to log on if they are not logged on already. If you set Log On Required to False, and no user is logged on, the dialog box is not displayed and Return Code is set to *Abnormal. Inherits from OBMAPI/Mapi Boolean.


Long
Mapi Long

Inherits from OBMAPI/Numeric and has a length of 10 and a C format of Long. Used for inheritance purposes by other class library fields.


Long Message ID Allowed

Specifies that returned message identifiers can be up to 512 bytes long. Inherits from OBMAPI/Mapi Boolean.


Mark Message As Read

Specifies whether to mark a message as read, and to send a read receipt, if requested. Inherits from OBMAPI/Mapi Boolean.


Message Handle

Points to information about a message. Inherits from OBMAPI/Handle.


Message ID

A message identifier. Inherits from OBMAPI/Mapi Text.


Message ID Filter

The criteria to use to search for a message. Inherits from OBMAPI/Mapi Text.


Message Text

The text portion of a message. Inherits from OBMAPI/Mapi Text.


Message Text To File

Specifies whether to save the text of a message to a file and use it as an attachment. Inherits from OBMAPI/Mapi Boolean.


Message Type

The type of message to search for. Inherits from OBMAPI/Mapi Character and has a length of 20.


Name

The name of a message recipient, as listed in an address book. Inherits from OBMAPI/Mapi Character and has a length of 35.


Number File Attachments

The number of attachments on a message. Inherits from OBMAPI/Mapi Long.


Number Of Addresses

The number of addresses to free in an address list. Inherits from OBMAPI/Mapi Long.


Number Of Edit Controls

The number of edit controls to display in an address list. Determines which controls display for each recipient class supported by Simple MAPI. When this field is 4, controls are set for each recipient class supported by MAPI, in this case, <To>, <Cc>, and <Bcc>. When it is 0, no controls are displayed, and the dialog box is read-only. Inherits from OBMAPI/Mapi Long.


Number Of Recipients

The number of recipients of a message, including copies. Inherits from OBMAPI/Mapi Long.


Numeric

A numeric field with zero decimal places. Inherits from OBMAPI/Field.


Originator Handle

Points to information about the sender of a message. Inherits from OBMAPI/Handle.


Parent Window Handle

The identifier of the top-level window of the application making the API call. Inherits from OBMAPI/Handle.


Password

A user's mail password. Inherits from OBMAPI/Mapi Character and has a length of 10.


Profile Name

The login profile of a user. Inherits from OBMAPI/Mapi Character and has a length of 50.


Prompt For Password

Specifies whether to prompt for only a password and leave the user name read-only or whether the user name can be changed. Inherits from OBMAPI/Mapi Boolean.


Read Header Only

Specifies whether to read only the header of a message or the body as well. Inherits from OBMAPI/Mapi Boolean.


Read Only Dialog Box

Specifies whether the contents of a dialog box may be modified. Inherits from OBMAPI/Mapi Boolean.


Recipient Handle

Points to information about a recipient in an address list. Inherits from OBMAPI/Handle.


Receipt Requested

Specifies whether the sender has requested a receipt notification message. Inherits from OBMAPI/Mapi Boolean.


Return Code

Contains the return value from run-time MAPI function calls. Inherits from OBJECTS/Integer and has a C format of Integer.


Selected Recipients Handle

Points to a list of the recipient entries selected for a message. Inherits from OBMAPI/Handle.


Session Handle

Points to information about a MAPI session. If the value is 0, the API attempts to create a temporary session, based on the values of Create New Session and Log On Required. Inherits from OBMAPI/Handle.


Subject

The subject line of a message. Inherits from OBMAPI/Mapi Character and has a length of 65.


Suppress Attachments

Specifies whether to include attachments with the message body. Inherits from OBMAPI/Mapi Boolean.


Text
Mapi Text

The text of a message. Inherits from OBMAPI/Mapi Character and has a length of 78.


Example 1
Select recipients and send mail

This example starts an explicit message session with a log on dialog box, displays the address book dialog with two edit controls, then displays the Send Mail dialog box with the recipients selected from the address book. Parameters are stored and mapped from the Local variable, which contains the fields needed for this example.

// Initialize fields in the Local variable to their default values

+For Each Field  Local
  +If  Fld default Val
    ++ Set Value  Fld default Val

Set  Local<Force message download> = True
Set  Local<Log on required> = True
Set  Local<Create new session> = True

API Call  Source code: OBMAPI/Start message session
If  Local<Return code> IS *Normal

Set  Local<Log on required> = False
Set  Local<Create new session> = False
Set  Local<Address caption> = 'Blue Sky Software'
Set  Local<Edit fields> = *Two

API Call  Source code: OBMAPI/Address a message

Set  Local<Recipient list handle> = Local<Selected recipients handle>

API Call  Source code: OBMAPI/Build message

Set  Local<Display dialog box> =True
API Call  Source code: OBMAPI/Send mail

API Call  Source code: OBMAPI/End message session


Example 2
Deliver mail and save messages

This example delivers mail by reading and saving mail messages. It starts an explicit message session, and finds and saves unread mail in order of time received. Parameters are stored and mapped from the Local variable, which contains the fields needed for this example.

// Initialize fields in the Local variable to their default values

+For Each Field  Local
  +If  Fld default Val
    ++ Set Value  Fld default Val

Set  Local<Force message download> = True
Set  Local<Log on required> = True
Set  Local<Create new session> = True

API Call  Source code: OBMAPI/Start message session

If Local<Return code> IS *Normal

Set  Local<Log on required> = False
Set  Local<Create new session> = False
Set  Local<Guarantee FIFO> = True
Set  Local<Long message ID allowed> = True
Set  Local<Find unread messages> = True
Set  Local<Message text to file> = True

API Call  Source code: OBMAPI/Return a message identifier
While  Local<Return code> IS *Normal

API Call  Source code: OBMAPI/Read a message
If  Local<Return code> IS *Normal

API Call  Source Code: OBMAPI/Save a message
If  Local<Return code> IS *Normal

API Call  Source code: OBMAPI/Free memory
If  Local<Return code> IS *Normal

Set  Local<Message ID> = *Zero
Set  Local<Message handle> = *Zero
Set  Local<Message type> = *Blanks
Set  Local<Message ID to filter> = *Blanks

API Call  Source code: OBMAPI/Return a message identifier

API Call  Source code: OBMAPI/End message session


Example 3
Send documents

This example displays the Send Documents dialog box with three file attachments using an implicit message session. The file attachments come from a list of full path names and file names from a panel. Parameters are stored and mapped from the Local variable, which contains the fields needed for this example.

// Initialize  fields in the Local variable to their default values

+For Each Field  Local
  +If  Fld default Val
    ++ Set Value  Fld default Val

Set  Local<Full path names> = Panel<Full path names>
Set  Local<Delimiter character> = Semicolon
Set  Local<File names> = Panel<File names>

API Call  Source code: OBMAPI/Send documents


Example 4
Send mail

This example displays the Send mail dialog box using a non-shared implicit message session following a log on request. Parameters are stored and mapped from the Local variable, which contains the fields needed for this example.

// Initialize fields in the Local variable to their default values

+For Each Field  Local
  +If  Fld default Val
    ++ Set Value  Fld default Val

Set  Local<Log on required> = True
Set  Local<Create new session> = True
Set  Local<Display dialog box> = True

API Call  Source code: OBMAPI/Send mail


Example 5
Resolve name and display address list entry

This example starts an explicit message session with a log on dialog box, resolves a name into a known address, and displays the properties of the address. Parameters are stored and mapped from the Local variable, which contains the fields needed for this example.

// Initialize fields in the Local variable to their default values

+For Each Field  Local
  +If  Fld default Val
    ++ Set Value  Fld default Val

Set  Local<Force message download> = True
Set  Local<Log on required> = True
Set  Local<Create new session> = True

API Call  Source code: OBMAPI/Start message session
If  Local<Return code> IS *Normal

Set  Local<Create new session> = False
Set  Local<Log on required> = False
Set  Local<Name> = Panel<Name>

API Call  Source code: OBMAPI/Resolve name

If  Local<Recipient handle> IS *Not Zero
Set  Local<Read only dialog> = True
API Call  Source code: OBMAPI/Display address list entry
API Call  Source code: OBMAPI/Free memory

API Call  Source code: OBMAPI/End message session