Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Received email
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00963045
Message ID:
00963056
Vues:
8
Perhaps you can use this and modify it to suit your needs.
How to determine when new mail has arrived using BindEvents
You can use the following code to create a COM server DLL and take action when a new e-mail arrives in Outlook. Please note that only the NewMail procedure is functional, but you can add your own code to make the others functional.
Note: this code is based on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfoxtk00/html/ft00j1.asp 
Note2 : This code requires that VFPCOM Utility be installed in the target computer (http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=1529819C-2CE8-4E89-895E-15209FCF4B2A)
Note3 : This will work in VFP7.0 and up

CODE
#DEFINE VFPCOM_CLSID  'VFPCOM.COMUTIL'
#DEFINE OUTLOOK_CLSID  'OUTLOOK.APPLICATION'
public goVFPCOM, goOutlook, goLink
goVFPCOM = create(VFPCOM_CLSID)
goOutlook = create(OUTLOOK_CLSID)
goLink = create('OutlookApplicationEvents')
goVFPCOM.BindEvents(goOutlook, goLink)
DEFINE CLASS OutlookApplicationEvents AS custom
  PROCEDURE ItemSend(Item,Cancel)
  ENDPROC
  PROCEDURE NewMail
  MessageBox('New Mail Has Arrived')
  ENDPROC
  PROCEDURE OptionsPagesAdd(Pages)
  ENDPROC
  PROCEDURE Quit
  ENDPROC
  PROCEDURE Reminder(Item)
  ENDPROC
  PROCEDURE Startup
  ENDPROC
ENDDEFINE
>Hi All,
>
>Does anyone know if there is a way to check for the received email in the mailbox?
>If yes, is it possible to check for specific words in the subject line or text of the new emails?
>And my last question, is it possible to access the attachments in the new received email and save them in a folder?
>
>Many thanks in advance,
>Bianca
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform