Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Custom GDI+ class
Obtaining names and positions for shortcuts located on the Windows Desktop
How to change display settings: screen resolution, screen refresh rate
Displaying dimmed window behind VFP top-level form
GDI+: Implementing image scrolling with inertia
Enumerating devices installed on the local machine
Subclassing CommandButton control to create BackColor property
Vertical Label control
Splash Screen for the VFP application
How to load a user profile
Browsing Windows Known Folders (Special Folders)
Moving shortcut to a specified position on the Windows Desktop
Disconnecting USB Mass Storage Device programmatically
How to make a VFP form fading out when released (GDI version)
Monitoring clipboard content changes (VFP9)
Printing Image File, programmatically set print page orientation to landscape
System Image List Viewer
How to put a horizontal text scrolling on the form (a news line, marquee)
Printing text with the Escape function
How to retrieve adapter information for the local computer (including MAC address)
How to print a bitmap file
Reading and setting system access privileges for the current process
How to put a vertical text scrolling on the form (a movie cast)
Enumerating Processes -- WinNT
Using custom Simple MapiSendMail class

User rating: 6/10 (1 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
click to open
Before you begin:
Get implementation code for the MapiSendMail class here.

Based on Simple MAPI functions this Custom class allows sending email messages from your default email client to multiple recipients with file attachments.

Related examples:
  • MAPI: sending email messages
  • MAPI: reading email messages
  • Winsock: sending email messages (SMTP, port 25)
  • Winsock: reading email messages (POP3, port 110)
  • Function MAPISendDocuments
  • #DEFINE cret Chr(13)+Chr(10)
    #DEFINE dret cret+cret
    PRIVATE obj
    obj = CreateObject("MapiSendMail")
    WITH obj
        * though the Sender object is implemented I never managed to make it
        * something else but the default address for the local email client
        .AddSender("A.A.", "someone@somwhere.mail")
        * add one or more recipients 
        * note that the following ones will not work, just an example
        .AddRecipient("Chivas Regal", "info@chivasregal.mail")
        .AddRecipient("Jim Beam", "info@.jimbeam.mail")
        .AddRecipient("John Walker", "info@.johnwalkermail")
        .AddRecipient("Canadian Club", "info@.canclubmail")
        .MsgSubject = "Test Message"
        .MsgBody ="This text will be put into body of your message." + dret +;
            "You can also use table fields and Text and Edit Boxes." + dret +;
            "Source:" + cret +;
        * adding file attachments
        * make sure that all files are available

    User rating: 6/10 (1 votes)
    Rate this code sample:
    • ~
    1097 bytes  
    Created: 2002-11-18 13:11:21  
    Modified: 2010-07-08 11:50:50  
    Visits in 7 days: 47  
    Listed functions:
    Printer friendly API declarations
    My comment:
    Although the Sender object is presented, it may not be properly recognized by the MAPI. In my tests, the Sender was always the default address of the local email client regardless of a value assigned.

    Prior to invoking MAPISendMail, ensure accessibility of all files to be attached.

    This class does not use MAPILogon and MAPILogoff functions (hSession=0). In this case -- it is called an implicit logon -- the MAPI session is of temporary type. An implicit session gets closed by the time the call returns.

    Tested on Windows XP Home Edition, Outlook Express 6.
    Word Index links for this example:
    Translate this page:
      Spanish    Portuguese    German    French    Italian offers instant, free translations of text or web pages.
    User Contributed Notes:
    There are no notes on this subject.

    Copyright 2001-2018 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.6.39), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (
    21 sec.Articles
    41 sec.Function: 'GdipCreateMatrix'
    1 min.
    Function group: 'Window'
    1.35 min.
    1.73 min.Function: 'CeRegEnumValue'
    Function group: 'Remote Application Programming (RAPI)'
    2.07 min.Example: 'Adding supplementary data to AVI files'
    2.4 min.Function: 'InternetTimeFromSystemTime'
    2.75 min.Function: 'NetUserEnum'
    Function group: 'Network Management'
    3.08 min.Function: 'CeDeleteRecord'
    Function group: 'Remote Application Programming (RAPI)'
    3.45 min.Function: 'CeRemoveDirectory'
    Function group: 'Remote Application Programming (RAPI)'
    Advertise here!