Mapi Sample Program

I’m new to MAPI and was wondering if somebody has a smalll MAPI program that works with NOTES. I’m looking for something to get me started. Thanks

Subject: Mapi Sample Program

I wonder what you want to achieve. Can you explain a little more? Anyway, I found this LotusScript test code. Note that MAPI has two meanings. It often refers to a limited API that is supported by many mail clients including Notes, but Microsoft also uses MAPI to refer to their proprietary Outlook-only API.

Type CString
     data(255) As Long
End Type

' for MAPIUser..Class
Const MAPI_ORIG = 0
Const MAPI_TO = 1
Const MAPI_CC = 2
Const MAPI_BCC = 3

Type MAPIUser
     Reserved As Long
     Class As Long
     Name As Long
     Address As Long
     EIDSize As Long
     EntryID As Long
End Type

Type MAPIMessage
     Reserved As Long
     Subject As Long
     Body As Long
     MessageType As Long
     DateReceived As Long
     ConversationID As Long
     Flags As Long
     Originator As Long
     RecipientCount As Long
     Recipients As Long
     FileCount As Long
     Files As Long
End Type

Declare Function MAPISendMail Lib "MAPI32" Alias "MAPISendMail" _
(  Byval hSession As Long, Byval UI As Long, message As Any _
,  Byval flags As Long, Byval zR As Long) As Long

Declare Function AddressOf Lib "MSVCRT" Alias "labs" _
(  V As Any) As Long

Declare Sub PokeString Lib "MSVCRT" Alias "memcpy" _
(  D As Any, Byval S As String, Byval N As Long)


Sub Click(Source As Button)
     sendto$ = {"Fredd Bloggs" }
     Dim Csendto As CString
     PokeString Csendto.data(0), sendto$, Len(sendto$)
     
     subject$ = "Just testing"
     Dim Csubject As CString
     PokeString Csubject.data(0), subject$, Len(subject$)
     
     body$ = "Hello!"
     Dim Cbody As CString
     PokeString Cbody.data(0), body$, Len(body$)
     
     Dim Msendto As MAPIUser
     Msendto.Name = AddressOf(Csendto)
     Msendto.Class = MAPI_TO
     
     Dim msg As MAPIMessage
     msg.Subject = AddressOf(Csubject)
     msg.Body = AddressOf(Cbody)
     msg.RecipientCount = 1
     msg.Recipients = AddressOf(Msendto)
     
     MAPISendMail 0, 0, msg, 0, 0
End Sub

Subject: RE: Mapi Sample Program

Thanks for your help. I was looking for a simple C++ program than I can play with to use for sending and receiving email.

Subject: RE: Mapi Sample Program

If you want to send email why not use a POP3 client? or just telnet to the SMTP port on 25.

My bigger question is why don’t you just send and receive mail within the domino environment.