General information
Category:
Windows API functions
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only