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 send an automatic email from foxpro for dos 2.6 application

Status
Not open for further replies.

amitapatel

Programmer
Jan 17, 2003
3
US
Hi all,
I want to know if this is possible in Foxpro for Dos environment. Are there any tools out there that I can use to achieve this.

I maintain an ordering system written in Foxpro for Dos 2.6. The client wants to add an E-mail functionalty to this system. When a status of an order is changed to completed in the system, the system should send an automatice email to the customer that the order is completed.

how can I do this in Foxpro for Dos 2.6 application? Is this even possible? Are there any external libraries out there that I can integrate with current system to achieve this?

your help will be greatly appreciated.

Thanks,
Amita Patel
 
amitapatel

I found this recently and I'm not sure if it works for you, I cannot test it where I am:
Code:
do emailer with 'pete.txt', 'despatch.txt'

procedure emailer
parameters sourcefilename, destinationfilename

set library to FOXTOOLS.FLL
getsysdir    = regfn("GetSystemDirectory","@CI","I")
bigstr        = replicate(chr(0),144) &&creates a big string
retlen        = callfn(getsysdir, @bigstr,144)
winsys        = left(bigstr,retlen)
sendmail    = regfn("MAPISendDocuments","L@C@C@CL", "L", winsys+"\MAPI.DLL")

t1            = ";"
t2            = "pete.txt"        && source file
t3            = "despatch.txt"        && name of file as attachment
x            = callfn(sendmail,0,@t1,@t2,@t3,0)
release library FOXTOOLS.FLL
Mike Gagnon

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

the code you posted is code that I wrote and posted on sep 12 02 in thread 182-357805 - "Automatically send email using Outlook"

the code was based on MS Knowledgebase Article 102467. (refer
I too cannot test it in the FP-DOS environment.


Pete Bloomfield
Down Under
 
repete

Thank you for clearing that up. If I ever post this code again, I'll be sure to include your name as the author (And Microsoft as well). Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I, too would be interested to try this code.

Where can I locate a copy of procedure library file :-
FOXTOOLS.FLL ?

Thanks
 
Actually, FOXTOOLS.FLL comes with FoxPro for Windows not DOS. In fact the above routines depend on running under Windows and using FPW.

For FoxPro for DOS, do a search here on BLAT - this is a DOS only solution for sending messages.

Rick
 
Just looked at gbMailer.
If you're running in a dos box under windows, this
may be of use. There's an exe in the zip file, but
I'm very reluctant to run unknown code on my machines.


I'm looking at the source code.

Are you running totally in dos?

Also, you don't seem to be responding
to all the help that's been offered.

Are you an ingrate? :)



Darrell 'We all must do the hard bits so when we get bit we know where to bite' :)
 
I am sorry for not repsponding. I am just observing the repsonses. I really appreciate all the help I am getting on this site. I have been pulled into another direction right now so I just haven't had a chance to try the code myself so I didn't have anything to report to.

I looked at BLAT on the web but didn't get much info.

My application is Foxpro for DOS running on a Win 2k environment.

Can you tell me more about GBmail or BLAT?
I don't have much experience using external libraries or applications with foxpro for dos.

has anyone ued BLAT or GBmail with foxpro for dos?
if you have then how did you integrate it with your application?

Thanks very much for your help

Amita
 
gbmail was recommended from ours system programmers.
In my case (FoxPro 2.0, NT 4 and Lotus Notes)
it work good service by sending text files.
Best way is go to source - find "gbmail" google
(unfortunately local Keyword Search ... No Search)
Tesar
 
thanks very much. I will try and see if I can down oad the souce or exe and see what I can do with my application.
 
AmitaPatel:

I believe Tesar and I are talking about two
different items. One is a service gbmail and
the other is a program gbmailer. Confusing huh?

Well since you're running in a dos box, you
may be able to use gbmailer or some other
'command line' emailer.

Beware - there are a number of vulnerabilities
with command line mailers, but if you'll probably
not run into them as Fox would fire off an email
and just disconnect.

Darrell

P.S. Here's a short description of gbmailer from
it's readme file.
* Getting results back would probably require piping
to an output file *

******************************************************
1. Description
--------------

GBMailer is command-line mailer wich will send an text file as mail.
It is written to be executed from CGI-scripts, but it can be used for
any other purpose.

See history.txt for changes in this version.

NOTE: Be sure to read Bugs section (section 2.) of this readme file
before mailing bug reports or questions about using GBMailer

USAGE:

gbmail [-v] -to <address list...> [-i] [-file <filename>] [-h <smtp.server.name>]
[-p <port_number>] [-from <address>] [-cc <address list...>]
[-bcc <address list>] [-s <Subject>] [-t <timeout>]
'We all must do the hard bits so when we get bit we know where to bite' :)
 
You may also be able to use Windows Scripting Host. It's a stab in the dark but after poking around a little, it seems doable.
Dave S.
 
Hi amitapatel,

BLAT is just like a dos application
Here is your program lines :
Run (wherever it is)blat /...(switches) /...(switches)
switches : 1. forwarding email address
2. name and location of attached files (your
main dish)
3. Your email add.
4. Heading
5. etc... etc...

Of course you would have to send your mail as an attachment xxx.txt file (which you would have prepare in former program lines in the first place).

Contact me if in necessary.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top