General information
Category:
ActiveX controls in VFP
Hi Erik:
On the Win2000 machine, which is my development box, I'm running both Outlook and Outlook Express, but I only use Outlook Express. On the Win98 machine, I'm using Outlook Express only. Here is the code from the Send Method of the main form. Thanx.
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.lstRecipients.LISTCOUNT - 1
.RecipIndex = i
.RecipDisplayName = THISFORM.lstRecipients.LIST(i + 1)
.RecipType = 1
NEXT
*- Get CC's
FOR j = 0 TO THISFORM.lstCC.LISTCOUNT - 1
.RecipIndex = j + i
.RecipDisplayName = THISFORM.lstCC.LIST(j + 1)
.RecipType = 2
NEXT
.MsgSubject = THISFORM.txtSubj.VALUE
.MsgNoteText = THISFORM.edtMsg.VALUE
*- Get Attachments
FOR i = 0 TO THISFORM.lstAttach.LISTCOUNT - 1
.AttachmentIndex = i
.AttachmentPosition = IIF(i = 0, 0, LEN(.MsgNoteText) - i)
.AttachmentPathName = oApp.exportdir + '\' + ALLTR(THISFORM.lstAttach.LIST(i + 1))
NEXT
.SEND(.F.)
ENDWITH
THISFORM.oMapiSession.SignOff()
Previous
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