Information générale
Catégorie:
Fonctions Windows API
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement