Home arrow Visual Basic arrow Page 2 - Sending Email With MAPI Components in Visual Basic

Sending Email With MAPI Components in Visual Basic

MAPI is an acronym for the Messaging Application Programming Interface. It's a set of core system components that can be used to automate several windows tasks. MAPI components allow developers to create mail-enabled Visual Basic applications easily. In this article Jason shows us how to use MAPI controls to read messages from our inbox, iterate through these messages, and more.

Author Info:
By: Jason Brimblecombe
Rating: 5 stars5 stars5 stars5 stars5 stars / 233
February 15, 2002
  1. · Sending Email With MAPI Components in Visual Basic
  2. · Using MAPI Components
  3. · Using MAPI Components (contd.)
  4. · Conclusion

print this article

Sending Email With MAPI Components in Visual Basic - Using MAPI Components
(Page 2 of 4 )

Using the MAPI controls involves two steps: firstly establishing a MAPI session, and secondly using various MAPI properties and methods to access and manage an individual inbox; for example, to create and send a message, include a file attachment, verify the recipient's email address against the email system's address book, etc.

Let's get started on the Visual Basic project, shall we? Start by creating a new standard executable application. You will need to add the MAPI components to your project, so start by clicking project from the top menu and find the menu item components (you may also use the hotkey CTRL+T). When the components window appears, scroll down the list until you find the Microsoft MAPI controls:

Adding the MAPI controls to our project

Place a check in the box next to it, and then click the OK button. Two additional controls have been added to the Visual Basic toolbox; they're called MAPISession and MAPIMessages. We will be using both of these in our application.

Setting up the form

Let's setup the layout of our Visual Basic application. Our form will contain four textboxes, three labels, four command buttons, and both of the MAPI components. You should layout the controls on your form so that it looks like this (alternatively, you can see the support material for this article and download the complete project):

The layout of our MAPI VB form

Here are the details of each component on our Visual Basic form:

Details of the controls on our form
blog comments powered by Disqus

- Developing an XML Web Service Using Visual S...
- Creating an HTML File List with VB
- Fun with Email: VB6, CDO, MAPI, and a Remote...
- Extranet/Intranet Dictionary Cracker in VB
- Finding Default App Icons With Visual Basic
- Registry Fever With Visual Basic
- Implementing An ADO Data Control With VB6
- Printing With Visual Basic
- MSMQ Part 1/2: Architecture and Simple Imple...
- Magnifying The Desktop With Visual Basic
- Sending Email With MAPI Components in Visual...
- Two Person Chat With The Winsock Control And...
- A Real-Time ActiveX News Control
- Accessing the Windows API in Visual Basic

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials