Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Email from within VFP
Message
 
 
À
03/11/1998 17:39:16
Bill Gravell
Indoor Purification System
Menifee, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00154134
Message ID:
00154163
Vues:
17
Bill,

Here's some sample code to use the MAPI controls that ship with VFP
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 = "DavidFrankenbach@worldnet.att.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
      j = inkey()
      if ( j = 27 )
         exit
      endif
   endfor
endwith

* Signoff

oleMAPISession.Signoff()
>Does anyone know of a way to interface VFP with any email system?
>I have a customer who wants to modify an application to automatically email a confirmation to a person who schedules a room with the system.
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