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

Email within FPD 2.6 2

Status
Not open for further replies.

SSDESIGN

Programmer
May 11, 2003
71
0
0
US
Client requested the capability of sending email from within his fpd 2.6 application. All email programs I have tried were external programs 'RUN' by a batch file and resulted in the error message "Program too big to fit in memory". Is there an email program, which can be loaded into the app and run without using an external program?

Having spent 39+ hours on trying to solve this error, any suggestions or program recommendations would be appreciated.

And just think, I wanted to do this for a living...
 
John, thank you so very much. You've pointed my nose in a new direction. Since I do not have any experience with writing in vbs script, any suggestions on where I could see examples for setting up the running of blat would be appreciated.

Once again, thanks...
 
I have never gotten the "Program too big to fit in memory" with blat, the code I use is this:
Code:
*Sends email using Blat.exe on workstation
*Assumes all workstations have same blat path
*Example call =SENDEMAIL('emailaddress','location_of_file_to_send','type_of_email')
FUNCTION sendemail
PARAMETERS emailaddr, emailfile, seType
PRIVATE mselec,blatpath,blatopt
mselec = ALIAS()
blatpath = 'c:\blat\blat.exe'
DO CASE
CASE TYPE('seType') == 'L' && seType not passed
	blatopt = FULLPATH(CURDIR())+'blatopt.txt'
CASE seType = 'S' && sale
	blatopt = FULLPATH(CURDIR())+'blatopt.txt'
CASE seType = 'R' && rental
	blatopt = FULLPATH(CURDIR())+'blatoptR.txt'
OTHERWISE
	blatopt = FULLPATH(CURDIR())+'blatopt.txt'
ENDCASE
*Put as many blat options in blatopt.txt as possible. If they are on the command line strange
*things happen, perhaps because command line gets truncated or otherwise mangled?
*Option -q (quiet) is ignored if it's in text file of options
IF FILE (blatpath)
   blatcomm = blatpath+' '+emailfile+' -to '+emailaddr +' -q -of '+blatopt
   ! &blatcomm
   semrslt = ''
ELSE
   semrslt = 'File '+blatpath+' not found. No emails sent'
   WAIT WINDOW semrslt
ENDIF
IF ! EMPTY (mselec)
   SELE &mselec
ENDIF
RETURN semrslt
I have gotten the error running other programs from Foxpro (Thunderbird for example), so I run those using vbs.

The basic idea is to use FoxPro to reate and run a couple of vbs files:
1) Create vbs script to run email program "c:\temp\temp.vbs":
Code:
set objShell = Wscript.CreateObject("Wscript.Shell")
CommandString = "thunderbird -compose to=emailaddress@sample.com,subject="
objShell.Run CommandString
2) Create another script "c:\temp\runtemp.vbs" to run 1st script:
Code:
Set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.Run "wscript.exe c:\temp\temp.vbs"
3)run "c:\temp\runtemp.vbs"
Code:
RUN 'WSCRIPT.EXE C:\TEMP\RUNFTP.VBS'
Looking at it now it seems rather convoluted, but it works for me.
Regards,
John
 
Also you can use os's command START.
Try in command window START /?

Tomas
 
Hi John -Sory but I am new to Fox Pro - I have used Blat a lot but how do i get a single variable into the blat procedure?

I can call a procedure dr_mail

Procedure dr_mail
run p:\operatns\blat\mail.bat
return

but I wish to include on the email subject a "variable" dr_wo

For username I can use %username% in the batch file but I am lost in foxpro!
Thanks in advance
 
OK I have sorted it out nowI was trying to get foxpro to call a batch file to send an email using a batch file which called blat.exe (because I did not understand foxpro!)

I now have foxpro generating the email and sending it with Blat.exe

Thank you for your nudge in the correct direction!

Just one little more of a nudge please!!

The routine that I have added the email to generates a database using =qcbld
after a bit of code defining what goes into DRBOM I then
SELECT DRBOM
SCAN NEXT 10
TEXT
<<PSTK>> <<NO_REQ*DR_QTY>> <<PHYSICAL>>
ENDTEXT
ENDSCAN

This then reports up to 10 lines of the DRBOM - how can I get it to report all of DRBOM?

I got to admit I am a complete novice and have used the Help and error logs generated by the application to guide me through so far!!

Thanks in Advance
Andy
 
The reason it only handles 10 records is that you have:

SCAN NEXT 10

Just remove NEXT 10 from that line and it will scan the entire table.

Tamar
 
OK So I have just proved my Novice Status!

I was just getting blind to the simplicity - got to remember the KISS principle Keep It Smple Stupid!

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top