Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax for message receipt in MAPI

Status
Not open for further replies.

culleoka

Programmer
May 16, 2002
85
US
I have a working MAPI session in VFP 5. But try as I might, I cannot get the right syntax to turn message receipt ON.
Can anyone help with this?
Pat
 
Thanks rschummer.
I have tried objMessage.MsgReceiptRequested = .T. with no success.
Do I have the syntax wrong?
Pat
 
Here is what I did in VFP 8 (enabled with IntelliSense

LOCAL ox as MSMAPI.MAPIMessages.1

ox = CREATEOBJECT("MSMAPI.MAPIMessages.1")
ox.MsgReceiptRequested = .T.

IntelliSense kicked in and showed me the property, and when I entered in the equals sign it prompted me for a .T./.F., so I suspect it is the correct syntax.

Could it be that you are not instantiating the same control? Or could it be the MAPI client on the computer does not support the property correctly?


_RAS
VFP MVP
 
Hi Pat.

I just tested this with my own custom MAPI wrapper class. This code:

Code:
*** Make sure we have a MAPI session established
lnSessionID = THIS.CreateSession( toSendParms.cUserName, toSendParms.cPassWord, toSendParms.lDownload )

IF lnSessionID > 0
  *** Create message and send it
  WITH THIS.oMessage
    .SessionID = lnSessionID
    .Compose()
    *** Make sure we have enough room to add the attachments on to the end of the body
    .MsgNoteText = toSendParms.cBodyText + CHR(13) + CHR(13) + ;
    SPACE( ALEN( toSendParms.aAttachments, 1 ) + 2 )
    .MsgSubject = toSendParms.cSubject
    .MsgReceiptRequested = toSendParms.MsgReceiptRequested 
    *** Add the recipients
    *** The e-mail address is column 1
    *** The recipient type is column 2
    FOR lnCnt = 1 TO ALEN( toSendParms.aRecipients, 1 )
      .RecipIndex = .RecipCount
      .RecipDisplayName = ALLTRIM( toSendParms.aRecipients[ lnCnt, 1 ] )
      .RecipType = toSendParms.aRecipients[ lnCnt, 2 ]
    ENDFOR
    *** Finally add the attachments
    *** find the correct position for the first one
    lnPos = LEN( toSendParms.cBodyText ) + 3
    IF NOT EMPTY( toSendParms.aAttachments[ 1 ] )
      FOR lnCnt = 1 TO ALEN( toSendParms.aAttachments, 1 )
        .AttachmentIndex = .AttachmentCount
        .AttachmentPosition = lnPos
        .AttachmentName = JUSTFNAME( ALLTRIM( toSendParms.aAttachments[ lnCnt ] ) )
        .AttachmentPathName = ALLTRIM( toSendParms.aAttachments[ lnCnt ] )
        lnPos = lnPos + 1
      ENDFOR
    ENDIF
    *** All systems go: send the e-mail
    *** An argument of 1 will open client to manually send composed message
    .Send( 0 )		
    *** Sign off
    This.oSession.SignOff()
  ENDWITH
ENDIF

This code works flawlessly in VFP version 8 and when toSendParms.MsgReceiptRequested = .T., it sets the property of the e-mail message correctly.

HTH




Marcia G. Akins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top