Use MAPI to Send E-Mail Messages

Problem

You want to send an e-mail message, but you don’t have a Simple Mail Transfer Protocol (SMTP) mail server configured for the computer.

Solution

Use the MAPI (Message Application Programming Interface) COM component, which interacts with the mail account configured on the current computer.

Discussion

MAPI is an interface that allows you to interact with the mailing features that are integrated into the Windows operating system. You can use MAPI (either through its unmanaged API, or through the MAPI COM component) to interact with the default mail client (usually Microsoft Outlook or Outlook Express). Tasks include retrieving contact information from the address box, retrieving the messages in the Inbox, and programmatically ...

Get Microsoft® Visual Basic® .NET Programmer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.