Platforms to show: All Mac Windows Linux Cross-Platform

/Win/Win MAPI
Feedback.

Function:
You find this example project in your Plugins Download as a Realbasic project file within the examples folder: /Win/Win MAPI
This example is the version from Mon, 3rd Jan 2010.
Notes: Last modified: Mon, 3rd Jan 2010
Class App
Inherits Application
// Constants
Const kFileQuitShortcut = Ctrl+Q
Const kFileQuit = E&xit
Const kEditClear = &Delete
End Class

Class Window1
Inherits Window
// Controls
ControlInstance
Sub Action() Handles Event
dim m as new MapiMessageMBS
dim r as new MapiRecipientMBS
dim o as new MapiRecipientMBS
dim file as new MapiFileMBS
dim t as TextOutputStream
dim f as FolderItem

f=GetFolderItem("test.txt")
t=f.CreateTextFile
t.WriteLine "Test file content"
t.Close

file=new MapiFileMBS
file.Path=f
file.Filename="test file"
file.Position=-1

o.Address="sender@example.com"
o.Name="Me"
o.Type=o.TypeOriginator

r.Address="receiver@example.com"
r.Name="You"
r.Type=o.TypeTo

m.AddFile file
m.AddRecipient r
m.Originator=o
m.Subject="Test Email"
m.NoteText="Hello World"
m.Flags=0

title=str(m.SendMail(self, true, true))

End Sub
End ControlInstance
ControlInstance
End ControlInstance
ControlInstance
Function MouseDown(X As Integer, Y As Integer) As Boolean Handles Event
ShowURL "http://en.wikipedia.org/wiki/Messaging_Application_Programming_Interface"

End Function
End ControlInstance

// Event implementations
Sub Open()
if MapiMessageMBS.IsAvailable then
MsgBox "MAPI present."
else
MsgBoX "No MAPI?"
end if

End Sub
End Class





Links
MBS REAL studio Plugins - Nachhilfe in Kretz