Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MAPI Only works the first time on WinXP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
MAPI Only works the first time on WinXP
Divers
Thread ID:
00579800
Message ID:
00579800
Vues:
53
I have some code that sends e-mails using the mapi ocx. Since upgrading my system to WinXP Pro I have noticed that the software will send the e-mail fine the first time it is executed, but subsequent sends fail. I do not receive any error messages, it acts like it works. I have to close VFP and restart it before it will send again. I have distilled the code down to what I feel is a pretty simple implementation, and verified that the code works on Windows 2000 and fail in windows xp. It does this in both VFP6 and VFP7. Am I doing something wrong?
mCurPath = SYS(5) + SYS(2003)

oleMAPISession = createobject( "MSMAPI.MAPISession.1" )

* Signon to mail
with oleMAPISession
   .UserName = ""
   .Password = ""
   .DownloadMail = .f.
   .Signon()
   * Check the SignOn status
   if ( .SessionID > 0 )
      oleMAPIMessages = createobject( "MSMAPI.MAPIMessages.1" )
      * tell the message the SessionID
      oleMAPIMessages.SessionID = .SessionID
   else
      SET DEFAULT TO &mCurPath
      return
   endif
endwith

* Send an email

with oleMAPIMessages
   .Compose()	

   * Set the Recipient name and resolve
   .RecipDisplayName = "paul@businessoftware.com"
   .RecipType = 1
*   .ResolveName()

   .MsgSubject = "testing"
   .MsgNoteText = "testing"

   .Send( .f. )
endwith

oleMAPISession.Signoff()

RELEASE oleMAPISession
RELEASE oleMAPIMessage

SET DEFAULT TO &mCurPath
Paul R. Moon
Business Software Solutions
paul@businessoftware.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform