E-MAIL

Kenneth Brody kenbrody at bestweb.net
Fri Jul 1 06:53:00 PDT 2005


Quoting Todd (Thu, 30 Jun 2005 16:23:29 -0700):

> sco5.07 / filepro 5.0.14r / mutt 1.4.2.1
>
>   I have an output processing that writes the output (invoices) to temp
> files in the users directory. These are the e-mail attachments. There
> could be anywhere from 1 (right now limited to 4) to as many as needed.
> They are named as QOinv0.txt, QOinv1.txt and so on depending on how many
> files the user chooses. The following processing is what I am using to
> select these attachments and send them. My question is, how can I do this
> without having to manually build the EXISTS() fields and without having
> to build the attachment line in mutt. I don't want to be limited to how
> many -a attachments I can fit on a line. Or even a better way to find the
> files other than the EXISTS() command.
> Make sense?
[...snip code which hardcodes command lines or each file count...]

Don't hard-code the "attach 1 file", "attach 2 files", "attach 3 files",
and so on, command lines.  Rather, build it in a loop.

The basic idea:

    BaseName = getenv("HOME") { "/Q0inv"
    Counter = "0"
    Command = "mutt -nz"
loop:
    FileName = BaseName { Counter { ".txt"
    If not exists(FileName) goto done
    Command = Command < "-a" < FileName
    Counter = Counter + "1"
    goto loop
done:
    Command = Command < "-s Invoice" < EmailAddress
    system Command

--
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list