In this chapter, we'll take a look at working with email in Visual Basic programs. Using the email support in Visual Basic, you can read email, send email, compose email messages, save, copy, and delete messages, display an address book, read and send attachments, forward email, and more. These functions are performed by the Messaging Application Program Interface (MAPI) controls that we'll add to our Visual Basic programs.
There are two MAPI controls: MAPISession and MAPIMessages. The MAPISession control establishes an email session, and the MAPIMessages control works with individual email messages in that session. The MAPI controls work with the underlying email system of your computer, and here we'll use the Microsoft Exchange email system, which comes with Windows. (It is reasonable to expect that your users will also have Microsoft Exchange.) We'll begin by making sure that Microsoft Exchange is set up for Internet Mail.