Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Using FtpCommand
Using the SetErrorMode for determining if a floppy drive is ready
Enumerating ports that are available for printing on a specified server
How to register custom Event Log source
Monitoring changes in a directory
Retrieving current settings for an ODBC connection
Testing serial ports
The SQLGetProp() creates a bridge between Visual FoxPro and the ODBC API
Displaying hypertext links with the SysLink control (VFP9, Comctl32.dll)
Displaying printer-properties Property Sheet for the specified printer
Retrieving information about all users currently logged on to the workstation (WinNT only)
Using Extended MessageBox() Class
Converting command-line string to a set of Unicode argument strings (WinNT only)
Enumerating the subkeys of a user-specific key
GDI+: Scrolling through large image using the mouse
Obtaining some properties for the Windows desktop using the GetWindowPlacement function
String representation for disk or memory capacity
Adding a background image to VFP report (VFP9, ReportListener)
Displaying icons in the system tray (VFP9)
Get the power status of your laptop computer
Using the RestartDialog function -- restarting Windows
Writing to INI file
Attaching menu to a top-level form
A client for testing non-blocking Winsock server
How to read email messages using Simple MAPI

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Before you begin:
This code retrieves messages from your mailbox (Inbox) and stores them in a cursor.

See also:
  • MAPI example (file attachments enabled)
  • MAPI: sending email messages
  • MAPI: reading email messages
  • Winsock: sending email messages (SMTP, port 25)
  • Winsock: reading email messages (POP3, port 110)
  • Function MAPISendDocuments

    FoxTalk articles:
  • Sending SMTP Messages in Visual FoxPro Applications, Part 1
  • Sending SMTP Messages in Visual FoxPro Applications, Part 2
  • Accessing Hotmail and MSN Accounts in Visual FoxPro
  •  
      Members area. Log in to view this example.
     
      User name:
      Password:
     
     
      Forgot your password?
     
      Sign up for
    the Membership
     
     


    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    5283 bytes  
    Created: 2002-01-29 20:23:46  
    Modified: 2011-12-10 09:20:22  
    Visits in 7 days: 81  
    Listed functions:
    MAPIFindNext
    MAPIFreeBuffer
    MAPILogoff
    MAPILogon
    MAPIReadMail
    Printer friendly API declarations
    My comment:
    Add MAPI_FORCE_DOWNLOAD to MAPILogon flags to to download messages before returning.

    Using the Outlook Express with rules applied to incoming messages moving them to folders other than Inbox folder, you have no chance to reach these messages through this code. Not to my knowledge, to say more precisely.

    Attachments are not processed in this example (MAPI_SUPPRESS_ATTACH flag). Using MAPI_PEEK flag ensures that MAPIReadMail does not mark the messages as read.

    Code for retrieving name and address for the recipient is not included. The routine is quite similar to the retrieving parameters for the sender (origin).

    If you are not able to logon, try use your messaging system profile name as a parameter. e.g. "Novell Default Settings".

    Check the VB link -- Updated Mapivb32.bas for Simple MAPI on 32-Bit Platforms (Q163216).

    * * *
    Each time the MAPIReadMail called without applying the MAPI_SUPPRESS_ATTACH flag, all attachments to messages in Inbox folder are copied to temp files. Continuous trying may seriously deplete the hard drive free space. Actually the MSDN suggests those temp files to be deleted once they are no longer needed.

    #kwd: sln_reademail.
    Word Index links for this example:
    Translate this page:
      Spanish    Portuguese    German    French    Italian  
    FreeTranslation.com offers instant, free translations of text or web pages.
    User Contributed Notes:
    Robert | 2008-01-11 15:47:47
    Hi,

    Is there any chance that you could add show an example with the ability to read the attachments of an email so these could be saved.

    I've seen VB incarnations of code to do this but I don't understand the VB structures and pointers

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q163216

    Refers to the VB code

    Thanks

    Rob
    A.M. | 2008-01-13 14:36:01
    Robert, I will post an update or new code sample within a few days.
    Robert | 2008-01-14 06:50:06
    Anatoliy,
    Thank you, I await with anticipation.
    Regards
    Robert

    Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

    Privacy policy
    Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (54.234.180.187)
    4 sec.Gallery
    Page 4
    6 sec.Function: 'InternetGetConnectedStateEx'
    Function group: 'Internet Functions (WinInet)'
    28.22 min.Example: 'Monitoring changes occurring within a directory'
    28.28 min.Example: 'How to print FoxPro form'
    3.9 hrs.Example: 'How to retrieve configuration data for a specified printer stored in the registry (PrinterDriverData key)'
    3.91 hrs.Function: 'GdipGetDpiX'
    5.51 hrs.Example: 'Retrieving the name of the network resource associated with a local device'
     Example: 'Using the SetErrorMode for determining if a floppy drive is ready'
    8.42 hrs.Example: 'Placing an arbitrary rectangular area of main VFP window on the Clipboard'
    9.16 hrs.
    Google
    Advertise here!