Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to upload a local file to FTP server using FtpPutFile
Accessing Adobe Reader 7.0 main menu from VFP application
How to adjust monitor brightness (Vista, monitor with DDC support)
HOWTO: Use the Win32 API to Access File Dates and Times
Winsock: reading and setting socket options
Creating irregularly shaped FoxPro form using transparency color key
Obtaining information about all user accounts on a server (WinNT only)
Subclassing CommandButton control to create BackColor property
Terminating all running applications from a VFP program
Copying picture of the active form to the Clipboard using Enhanced Metafile API functions
Creating a window using CreateWindowEx function
Displaying dimmed window behind VFP top-level form
GDI+: Storing content of the Clipboard to a bitmap file
Loading a string resource from an executable file
Retrieving file information for the VFP executable running
Start an executable from VFP application by using the CreateProcess
WAV file player
Creating the Open dialog box to specify the drive, directory, and name of a file to open
Downloading files from the FTP server using InternetReadFile
How to make the caption of a VFP application flashing in the Windows task bar
A client for testing non-blocking Winsock server
Splash Screen for the VFP application
Storing screen shot of a form to bitmap file
Drawing a rectangle using Windows regular edges and borders
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
Versions:
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 +;
            "http://www.news2news.com/vfp"
     
        * adding file attachments
        * make sure that all files are available
     
        .AddAttachment("C:\myfiles\Resume\cover.txt")
        .AddAttachment("C:\myfiles\Resume\cv.doc")
        .AddAttachment("C:\myprogs\sample.PRG")
     
        .SndMessage
    ENDWITH
     
     
     

    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: 103  
    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  
    FreeTranslation.com offers instant, free translations of text or web pages.
    User Contributed Notes:
    There are no notes on this subject.


    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 (67.202.9.192)
    9 sec.Example: 'How to set Creation Date/Time for a folder (WinNT)'
    2.97 hrs.Function: 'RegDeleteValue'
    Function group: 'Registry'
     Example: 'Winsock: changing the byte ordering'
    3.3 hrs.Example: 'How to view icons stored in executable files (Icon Viewer) - II'
     Example: 'Converting an integer value to a hexadecimal string'
     Example: 'Reading STARTUPINFO structure for the current VFP session'
    4.77 hrs.Function: 'DragAcceptFiles'
    Function group: 'Shell Functions'
     Function: 'SetFileTime'
    4.78 hrs.Example: 'Saving HKEY_LOCAL_MACHINE\\Software\\ODBC Registry Entries to an XML file'
    4.99 hrs.
    Google
    Advertise here!