This library implements Simple Messaging API (MAPI) to send, receive, and manage e-mail messages for Visual Smalltalk in MS Windows.
There are several ways to enable messaging in an application via MAPI (messaging application programming interface) [1]. The optimal solution depends on the given requirements. Visual Smalltalk implements the CMC (common messaging classes). This works well in several cases, e.g. if the installed mail client is Outlook 97. A standard Windows 98 installation includes the Internet Explorer 4 as browser and the Outlook Express as email client. Microsoft Outlook Express can be used as the default SimpleMAPI client [2].
Objectives:
| Smapi.sll Smapi.sml |
Simple MAPI library and source |
| Smapi.htm | Documentation |
VS/VSE 3.1.2 for Win32s. Requires the MAPI library vmapi31w.sll.
Copy the SMAPI.SLL file to the VS/VSE library directory or a directory that appears in the Windows PATH statement. Install MAPI Support using the VS/VSE Service Manager prior to installing SMAPI.SLL. Or, evaluate the following:
#('vmapi31w' 'smapi') do:[:lib|SmalltalkLibraryBinder bindTo: lib].
For the following example substitute:
| Recipient name | Forename Lastname |
| Recipient address | FLastname@ASampleCompany.com |
| File attachments | file1.txt file2.txt |
Then open a workspace and evaluate the example portions below:
"send a simple message using the underlying mail client"
SimpleMailSession new sendMail
"send a document"
SimpleMailSession new sendDocuments: #('file1.txt' 'file2.txt')
"sending a prebuild mail"
SimpleMailSession new sendMail:
(SimpleMailMessage
to: #( ('Forename Lastname'
'SMTP:FLastname@ASampleCompany.com') )
subject: 'This is the subject
text'
text: 'This the body text\next
line\last line' withCrs
attachments: #('file1.txt'
'file2.txt')).
"read all incoming mail"
session := SimpleMailSession logon.
ids := session findAll.
mails := session readMailAll.
session logoff.
Please refer to the SMAPI.HTM file for more information on the implementation and consult the references below:
1.MAPI SDK, Concepts: About the MAPI Architecture
2.Set Outlook Express as Your Default Simple MAPI Client, Microsoft Support
#Q178077, August 19, 1998
3.MSDN Library, Win32 Messaging
4.MAPI SDK, References: SimpleMAPI Functions and Structures
5.MSDN, Developing Messaging Applications - The ActiveX Way, Venu Yerra,
July 1997
Lars Niedermeier
ln@goit.de
Links to:
The
ObjectShare web site
VisualSmalltalk
Product Support
ObjectShare's Online Documentation
Site