Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using ShellExecute to send a GroupWise e-mail
Message
De
11/05/2000 11:20:25
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Using ShellExecute to send a GroupWise e-mail
Divers
Thread ID:
00368594
Message ID:
00368594
Vues:
100
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 Yater
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform