WITH THISFORM.oMapiSession
.DownloadMail = .F.
.SignOn()
SET DEFAULT TO (oApp.HOMEDIR)
IF (.SessionID > 0)
THISFORM.oMAPImsg.SessionID = .SessionID
WAIT WINDOW 'Logged In' NOWAIT
ELSE
WAIT WINDOW 'Login failed' NOWAIT
RETURN
ENDIF
ENDWITH
WITH THISFORM.oMAPImsg
.MsgIndex = -1
.Compose()
*- Get Recipients
FOR i = 0 TO THISFORM.cboRecipients.LISTCOUNT - 1
.RecipIndex = i
.RecipDisplayName = THISFORM.cboRecipients.LIST(i + 1)
.RecipType = 1
NEXT
*- Get CC's
FOR j = 0 TO THISFORM.cboCC.LISTCOUNT - 1
.RecipIndex = j + i
.RecipDisplayName = THISFORM.cboCC.LIST(j + 1)
.RecipType = 2
NEXT
.MsgSubject = THISFORM.txtSubj.VALUE
.MsgNoteText = THISFORM.edtMsg.VALUE
*- Get Attachments
FOR i = 0 TO THISFORM.cboAttach.LISTCOUNT - 1
.AttachmentIndex = i
.AttachmentPosition = IIF(i = 0, 0, LEN(.MsgNoteText) - i)
.AttachmentPathName = oApp.exportdir + '\' + ALLTR(THISFORM.cboAttach.LIST(i + 1))
NEXT
.SEND(.F.)
ENDWITH
THISFORM.oMapiSession.SignOff()
Précédent
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