I use the "Outlook.Application" object function to retrieve an existing instance of the Outlook application object and then use a method to send emails that are
stored in the "Outbox" folder, which is where outgoing emails are temporarily
stored before they are sent.
Here's an example of how you can send emails from the "Outbox" folder using theOutlook.Application-Object.
Best regards,
Otto
- Code: Select all Expand view
function Main()
local olApp := CreateObject( "Outlook.Application" )
local olns := olApp:GetNameSpace( "MAPI" )
local oUserFolder := olns:Folders( "info@winhotel.at" )
local oFolder := oUserFolder:Folders( "Posteingang" )
local n, n2, n3, n4
local aFolders := {}
local oMail
local aEmails := {}
// function to retrieve an existing instance of the Outlook application object
// and then use a method to send emails that are stored in the "Outbox" folder,
// which is where outgoing emails are temporarily stored before they are sent.
// It then loops through all items in the "Outbox" folder and sends any email that has not been sent yet using the Send method.
FOR n = 1 to olNS:Folders:Count
AADD( aFolders, olNS:Folders( n ):name )
if olNS:Folders( n ):name = "info@winhotel.at" //"otto@atzwanger.com"
oUserFolder := olNS:Folders( n )
FOR n2 = 1 to oUserFolder:Folders:Count
AADD( aEmails, { oUserFolder:Folders( n2 ):name , "V E R Z E I C H N I S", oUserFolder:Folders:Count } )
oFolder := oUserFolder:Folders( n2 )
if oUserFolder:Folders( n2 ):name = "Postausgang"
AADD( aEmails, { oFolder:name , "o F o l d e r ", oFolder:Items:Count } )
FOR n4 = 1 to oFolder:Items:Count
oMail := oFolder:Items( n4 )
AADD( aEmails, { oUserFolder:Folders( n2 ):name , oMail:subject } )
oMail:Send()
next
endif
next
endif
next
xbrowse( aEmails )
return nil