Fw: Favor
Kenneth Brody
kenbrody at bestweb.net
Thu Jan 27 13:09:44 PST 2005
Dennis Malen wrote:
[...]
> > I have a processing table that creates an Excel spreadsheet...I want to be
> > able to send that spreadsheet to the user from within filePro not
> > UNIX...how
> > can I do that?
> >
> > I would do a lookup to a table using @id to get the email address I
> > need...when I send an email from UNIX, here is a sample of the code
> >
> > echo "Generated By /util/dailynext" > /tmp/dayfile
> > #
> > uuencode /tmp/daily$dt.csv "Daily.Mail.Rpt.$dt.csv" >> /tmp/dayfile
> > #
> > cat /tmp/dayfile | mail -s "Daily Mail Rpt" courtney at northshoreagency.com
> >
> > Any ideas greatly appreciated...
Assuming the environment variable "dt" was set somewhere (which would
have to be the case for the above to work) you have several choices.
One would be to create a script:
(
echo "Generated by /util/dailynext"
uuencode /tmp/daily$dt.csv "Daily.Mail.Rpt.$dt.csv"
) | mail -s "Daily Mail Rpt" "$1"
(Note that your command sequence uses a hardcoded temp filename, which
means you cannot have two people run it at the same time. The above
uses no temp files, and can can concurrent executions without problem.)
Then call the script from filePro, passing the e-mail address:
SYSTEM "/path/to/script '" { email_address { "'"
Another option would be to simply SYSTEM the entire command sequence
above, and skip the shell script entirely.
Of course, this doesn't actually send the file as an attachment, but
rather as inline text. Some e-mail programs recognize uuencoded text
and treat it as if it were an attachment, but others do not.
--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap at gmail.com>
More information about the Filepro-list
mailing list