Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Email VFox7.0

Status
Not open for further replies.

ChibiNeko

Programmer
Joined
Sep 26, 2002
Messages
13
Location
US
Hi,

I have a button on a form, when clicked it opens a new email message. To me, it looks like my code is specifying that a user must have MS Internet Explorer, and MS Outlook Express in order to send out an email message.

Question---> Is there a way that I can check to see what a user's default email client is? There's gotta be either an ActiveX control for this purpose, or a built in Visual FoxPro function that does this. Here's the code that I'm currently using in the Click Event of the button:

LOCAL l_oIE, l_emailaddr

l_oIE=CREATEOBJECT("InternetExplorer.Application")
IF TYPE('l_oIE') <> 'O'
g_osubs.displaymessage(&quot;Unable to create InternetExplorer Object for mail processing.&quot;)
else
l_emailaddr = &quot;mailto:my@emailAddress.com&quot;
l_oIE.Navigate(l_emailaddr)
RELEASE l_oIE
endif

 
a built in Visual FoxPro function that does this.

No, there aren't any VFP functions to do that. Take a look at the FAQ section, there are a few suggestions to send e-mails via VFP and automation.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
ChibiNeko,

try this:

Run RegEdit;
Open HKEY_CURRENT_USER\Software\Microsoft\MSDetect\AllApps\EMAIL;
Check DetectionCount value: if it's non-zero - check the sub-keys to see which E-Mail client is installed.

HTH.

Regards,

Ilya
 
My win2k machine doesn't have a key at:
\\HKCU\Software\Microsoft\MSDetect
 
wgcs:
My win2k machine doesn't have a key at:
\\HKCU\Software\Microsoft\MSDetect

Maybe, mine is WinME. Anyway, there should be something else to find it out. I ran the search for &quot;EMAIL&quot; in my RegEdit, and that was what it turned up.

Regards,

Ilya
 
IRANYY and wgcs,

I'm aware that this is stored as a Windows Registry setting but, I'm a bit leery at calling or querying for a Microsoft Registry key, the name/location/value in the Registry likely varies by the version of Windows operating system that a user has, as (wgcs pointed out with Win Me).

Maybe a MAPI library can do this check for &quot;which application is the default email client&quot; for me, I'm not sure.
 
ChibiNeko,

I'm not clear why you have to instantiate Internet Explorer. If you just ShellExecute() the mailto: link, you will get the same result.

Here is some code:

DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, STRING cAction, STRING cFileName, ;
STRING cParams, STRING cDir, INTEGER nShowWin

lcMail = &quot;mailto:john@mycompany.com&quot;
ShellExecute(0,&quot;open&quot;,lcMail,&quot;&quot;,&quot;&quot;,1)

For more details, see:

Mike


Mike Lewis
Edinburgh, Scotland
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top