Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Winsock: sending email messages (SMTP, port 25)
Custom GDI+ class
Using EnumPrinters function to enumerate locally installed printers
Semi-transparent Form
Custom HttpRequest class (WinHTTP)
Custom HttpRequest class (WinINet)
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
How to convert a bitmap file to monochrome format (1 bpp)
Compressing and decompressing files with Windows API Runtime Library routines
Printing Image File, programmatically set print page orientation to landscape
Custom FTP Class for Visual FoxPro application
How to create MD-5 and SHA-1 hash values from a string
Using FoxTray ActiveX control: System Tray Icon and menu attached to VFP form
Extended MessageBox Class
Transparent Menu Class (requires VFP9)
Creating irregularly shaped FoxPro form using transparency color key
Adding icon to the systray (requires VFP9)
How to ping a remote site using ICMP API calls
How to create non-blocking Winsock server
Using Month Calendar Control (VFP9, Comctl32.dll)
How to print FoxPro form
How to detect if additional monitor is connected and active
GDI+: saving image of FoxPro form to graphics file (BMP, GIF, JPG, PNG, TIF)
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
     
      Buy this example for $10.00
    Instant email delivery.

    Read more...
     


    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    5283 bytes  
    Created: 2002-01-29 20:23:46  
    Modified: 2008-12-03 15:26:21  
    Visits in 7 days: 49  
    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-2010 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.0.85), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (38.107.191.105)
    5.13 min.Function: 'GdiFlush'
    Function group: 'Painting and Drawing'
    9.07 min.
    Function group: 'GDI+'
    16.4 min.Function: 'GetPriorityClass'
    Function group: 'Process and Thread'
    46.25 min.Function: 'GdipCreateHICONFromBitmap'
    53.48 min.Function: 'mciSendString'
    Function group: 'Windows Multimedia'
    55.93 min.Function: 'GdiGetBatchLimit'
    Function group: 'Painting and Drawing'
    5 day(s)Example: 'Retrieving list of available disk drives'
    Google
    Advertise here!