Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLE Messaging
Message
From
29/11/1997 05:54:23
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
OLE Messaging
Miscellaneous
Thread ID:
00062845
Message ID:
00062845
Views:
67
I'm trying to send e-mail to several people and I'm using OLE messagin instead of the mail ocx that comes with VFP. I tried putting the code in a SCAN/ENDSCAN loop. It works for the first record but bombs on succeeding records. How do I accomplish this in the most efficient manner? (Code is taken from KB article on OLE messaging with mods).

USE o:\apps\data\analysts in 0
GO top

SESSION=CREATEOBJECT('mapi.session')
SESSION.LOGON

NEW=SESSION.OUTBOX.MESSAGES.ADD
NEW.SUBJECT = "Test Mail with OLE Messaging"
NEW.TEXT="Mail System Test"+CHR(13)+"using OLE!"+chr(13)


SELECT analysts
SCAN
SENDTO=NEW.RECIPIENTS.ADD
SENDTO.NAME=alltrim(analysts.emailaddress)
SENDTO.TYPE=1
SENDTO.RESOLVE

NEW.ReadReceipt = .T.
NEW.DeliveryReceipt = .T.
NEW.UPDATE
NEW.SEND(1,0,0)
ENDSCAN
SESSION.LOGOFF
Next
Reply
Map
View

Click here to load this message in the networking platform