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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to auto send email insite foxpro program 2

Status
Not open for further replies.

mengzs

MIS
Jul 23, 2001
17
US
Hi,

I want add an EMAIL button in my application. So the user can recevice notify information by email when specific events happened. We are using Foxpro 2.6a and Exchange 4.5

Or Any one know how to activate Outlook inside Foxpro ?


Thanks
 
Since you are using 2.6a you do not have a lot of choices.
First you have to see if outlook is installed on the computer and get the directory location
second you have to start it

=RunExe( IsFileInReg("OUTLOOK.EXE") , "" , 1)

David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
David:

I would have thought Mengzs was interested in actually sending or receiving email through Outlook from his FoxPro 2.6 application (although he/she did not actually ask that question).

I am interested in sending an email (with attachment) to a 32-bit mail server (Micorsoft Exchange) from a 16-bit FoxPro 2.6 application. Do you know how to do that?

Norm Dafoe
 
Since many viruses call Outlook with Visual Basic Scripts, sending mail with Outlook by OLE , DirectX is well documentated. So I made the assumption that Mengzs already tried the OLE approach. That could have been a bad assumption on my part. I do not use outlook becuse of its ability to pass viruses. My customers are to valuable to me to have OutLook Express installed on my computer. The routines above I use to send mail with Eudora. David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
David:

I appreciate your concern about viruses, but I assure you that this is not my motive for investigating this problem. I too use Eudorea for my personal mail, for that very reason. I have a government client who operates behind a firewall, with full anti-virus software, who have chosen MS Exchange/Outlook as the corporate email solution. I simply want to use the existing infrastructure to exchange data for my FoxPro 2.6a app.

I know I am late to the party, but I am trying to get up to speed AQAP. Could you point me to some online or printed information which would outline the OLE approach? I have already tried to use FOXMAPI.FLL (16-bit) to communicate with Outlook (32-bit) and it does not seem to work (I am looking further into the 'thunking' problem). According to Tom DeMay's article in FoxPro Advisor Dec.1996, OLE will not work with FoxPro 2.6 or 2.6a. Is there any more up-to-date info on this subjec? I would appreciate any guidance you can give.

Norm Dafoe
Ottawa Canada
 
Thanks, David and Normandy.

Let me make my question more clear.
1. We have foxpro 2.6a , MS outlook and exchange 4.5
2. Inside foxpro application, I need to add one "Email" button. When a user hit the button, A message (with attachments) is auto sent to email address on the same screen.
3. The user just got a confirmation message whether the message was sent or not.
4. email program wmay use exchange service directly or
use outlook object to auto send out message. HOW ?
5. I have outlook vbs script as below, I have to use "Run ..." to run it. And a DOS screen popup, How can I call script directly inside forpro, not through DOS command.

Her is the VBS script. To run it, save it to "email.vbs"; then at DOS prompt,type "Wscript email.vbs"
--------------
set objoutlook=CreateObject("Outlook.Application")
set objmail=objoutlook.CreateItem(0)
objmail.Recipients.Add("mengzs@yahoo.com")
objmail.Subject = "Email Script Test"
objmail.cc = "mengzs@yahoo.com"
objmail.Body = vbcrlf&" Body Message Here."
objmail.Attachments.Add("c:\autoexec.bat")
objmail.Send
objoutlook.quit
set objmail=nothing
set objoutlook=nothing
 
Here is some code I picked up somewhere (I apologize to the author for not being more diligent). It shows one way to run some VBS code from FPD, using low-level IO commands to temporarily build a script and then execute it.

"Network redirection of printers... Shelling out of FPD26 towards the command prompt and calling the NET USE command never was a good solution. So I now use the following code:

sPrtPort = "LPT1:"
sPrtMap = "\\PRTSERVER\PRINTER1"
OutChan = FCREATE("C:\FOXPRO\WSHPrint.VBS")
IF OutChan > 0
=FPUT(OutChan,'Set WshNetwork = WScript.CreateObject("WScript.Network")')
=FPUT(OutChan,'On Error Resume Next')
=FPUT(OutChan,'WshNetwork.RemovePrinterConnection "' + sPrtPort + '"')
=FPUT(OutChan,'WshNetwork.AddPrinterConnection "' + sPrtPort + '", "' + sPrtMap + '"')
=FCLOSE(OutChan)
Tmp_4 = "RUN /0 CScript C:\FOXPRO\WSHPrint.VBS //B //NoLogo //T:60"
&Tmp_4
SET PRINTER TO &sPrtPort
ENDIF


As you can hopefully see, this opens up a number of possibilities by simply using the string handling capabilities of FP and a little creativity.

Rick
 
Also I need to send a foxpro report by email, by clicking a button, I would like to know if someone of you did it ? please help me!!! I have foxpro 2.6 for windows and We use microsoft outlook . .
 
Try to use the free sofware hotsend
it's very easy.

pepmarti@teleline.es
 
What's that softwate hotsend? sorry my ignorance but I don't know about it... Where can I find it? thank you pepmarti . .
 
Pepmarti:

I have just downloaded hotsend.exe from the folks who make eFax Messenger at pub/ccc/harvest/Harvest_Forum/HotSend/hotsend.exe. It appears to be a reader to be sent along with an email attachment to help the receiver view faxes, images etc. (perhaps like Adobe Acrobat & pdfs).

If this is the product you are suggesting, I don't think it fills the bill for what we want to do in FoxPro. I want to be able to send an email with a data file attached to other users of my software. Viewing the attachment is not necessary. In fact, I will import the attached file in order to update another copy of my Foxpro database.

Perhaps there is another hotsend product out there? Could you be more specific?

Norm
 
Yes, it is... your mail attached a digital document with a viewer in. Is to easy, makes a printer and you can chose the printer before printing, in your foxpro software... the hotsend start a wizard to send e-mail.

 
It's true is really easy to use this software, thank you very much pepmarti !!!
 
One way is this :

run C:\archiv~1\outloo~1\msimn.exe

If you find a way to send email from your foxpro application please let me know.
 
hey rick, i read your fput io solution, does that mean i can wright a vbscript and use fget?? allows useing vbscript as user interface to foxpro program? (almost like cgi for foxpro26dos)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top