Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using ShellExecute to send a GroupWise e-mail
Message
 
À
11/05/2000 11:20:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00368594
Message ID:
00368619
Vues:
21
>Several months ago, one of our developers (since departed) wrote a function to allow us to send e-mail from our VFP application. This is done by using ShellExecute and passing it a mailto address and a subject line. Here is the code:
>
>
>** m2mEntryform.NewEMail()
>PARAMETERS lcRecipient, lcSubject
>
>lcMailTo = "mailto:" + ALLT(lcRecipient) + IIF(NOT EMPTY(lcSubject), "?subject=" + lcSubject, "")
>
>** ShellExecute parameters: hWnd Integer Window Handle
>** lpOperation String Operation to perform
>** lpFile String File, URL, or e-mail address to use
>** lpParameters String Not used in our implementation
>** lpDirectory String Not used in our implementation
>** nshowCmd Integer Not Used in our implementation
>
>DECLARE INTEGER ShellExecute IN SHELL32 INTEGER, STRING, STRING, STRING, STRING, INTEGER
>
>=ShellExecute(0, 'OPEN', lcMailTo, '', '', 1)
>
>RETURN
>
>
>
>This works fine for Outlook or Outlook Express. However when we try to do this on a machine that is using GroupWise as their e-mail client (which has a FROM field as well as a TO field), the mailto address winds up in the FROM: field, and the subject winds up in the TO: field. I've been handed the responsibility of correcting this problem, but I'm not even close to a Win32API expert.
>
>Is there any way that I can force the mailto: address into the TO field, regardless of wheter I am using Outlook or GroupWise (or Lotus Notes, for that matter), or pass an optional from: field that will be ignored if the e-mail client (Outlook) does not make use of it? If not, is there an easy way (i.e., redesigning the e-mail utility with WestWind's tools are not an option) that I can detect what my e-mail client is, and then create my lcMailTo variable accordingly?
>
>TIA,
>
Bill,

If the various applications have different syntax or order of fields for sending the email, then what needs to be done is check the for email application and format the string accordingly. I'm not entirely sure what the best way to do this would be. There is a registry key (under Win98SE) that might be what you need:

HKEY_CURRENT_USER\Software\Microsoft\MSDetect\AllApps\EMAIL

This, on my machine, lists a number of various email clients, and which ones are installed. Neither GroupWise nor Notes were included, however.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform