HOWTO: Send Mail from Visual Basic Using OLE MessagingLast reviewed: November 21, 1997Article ID: Q161833 |
The information in this article applies to:
SUMMARYThis article outlines the steps necessary to programmatically send an e-mail message from Visual Basic using the OLE Messaging Library. This example assumes that the OLE Messaging Library was properly installed on your computer (typically, by installing Exchange). The sample code can also be used from VBA, allowing Access, Excel, or Project to send e-mail via the OLE Messaging Library.
MORE INFORMATIONWith the OLE Messaging Library, you can quickly and easily add e-mail capabilities (that is, sending and receiving e-mail messages, and interacting with folders and address books) to your Visual Basic application. You can create programmable messaging objects, and then use their properties and methods to meet the needs of your application. The objects and methods exposed by the OLE Messaging Library are much more robust than the MAPI controls that ship with Visual Basic, thus allowing access to many MAPI properties that the MSMAPI OCX controls simply do not address. "Microsoft OLE Messaging Library Programmers Reference" is available in the Microsoft Developer Network (MSDN), or the Olemsg.hlp file that installs with Exchange Forms Designer 4.0. NOTE: If this object library is not available in the References list, click the Browse button and search your Windows\System folder for the file Mdisp32.tlb.
Sample CodeTo build a Visual Basic project that sends a simple message, follow these steps:
REFERENCESMicrosoft OLE Messaging Library Programmers Reference For additional information about Collaboration Data Objects versus Active Messaging, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q176916 TITLE : INFO: Active Messaging and Collaboration Data Objects (CDO) Keywords : kbprg ActMsg OLEMSG vbwin Technology : kbole kbvba Version : WINDOWS:4.0 Platform : WINDOWS Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |