Visual Basic for Network Applications

The MAPI controls

There are two main MAPI controls that give your VB applications access to the mail services of Microsoft Mail/Exchange installed in Windows. These two controls are MAPISession and MAPIMessages. The first, MAPISession, is used to establish a session, log on and log off; the second, MAPIMessages, is used to actually send, read and manipulate the messages.

With the MAPI controls, you can carry out a range of mail functions and can link in to the resources provided by the mail system client, including the following functions:

  • access messages in the InBox

  • compose a new message

  • manage recipients of a message

  • manage attachments of a message

  • send messages

  • manage messages (copy, delete)

  • access the Address Book

  • reply to or forward new incoming mail

MAPISession control

This control allows you to create a new session, sign on, sign off and ensure that the username and passwords are correct. Once you have placed the MAPISession icon on your form, it is invisible at run time and is controlled entirely via its properties and methods. This property must be used to establish a session before any messages can be sent or received; the MAPISession control will provide a SessionID handle that must be passed to the MAPIMessages control to carry out any message functions. The main properties for the MAPISession control are:

  • Action

  • DownloadMail

  • LogonUI

  • NewSession

  • Password

  • SessionID

  • UserName

Action

Control

MAPISession property

Syntax

object.Action = value

Arguments

value = 1

logs the user into the account specified by the UserName...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: E-Mail Software
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.