Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Looking for sample code for programmatically recieving e
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00110602
Message ID:
00110698
Vues:
19
Greg,
\vfp\samples\solution\solution.app has one. Here's another I cooked up:
activate window "debug output"

* simple test email program using MAPI

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

* Signon to mail
with oleMAPISession
   .UserName = "Test"
   .Password = ""
   .Signon()
   * Check the SignOn status
   if ( .SessionID > 0 )
      oleMAPIMessages = createobject( "MSMAPI.MAPIMessages.1" )
      * tell the message the SessionID
      oleMAPIMessages.SessionID = .SessionID
      debugout "Successful mail log on"
   else
      debugout "Mail login failed"
      return
   endif
endwith

* Send an email

with oleMAPIMessages
   .Compose()

* Set the Recipient name and resolve
   .RecipDisplayName = "YourName@YourDomain.net"
   .RecipType = 1
   .ResolveName()

   .MsgSubject = "This is the Subject"
   .MsgNoteText = "This is the email text"

   .Send( .f. )
endwith

* Read the InBox

with oleMAPIMessages
   .Fetch()
   for i = 0 to .MsgCount-1
      .MsgIndex = i
      debugout .MsgSubject
   endfor
endwith

* Signoff

oleMAPISession.Signoff()
>Anyone know where I can find some sample code using mapi to send & recieve email ?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform