E-MAIL

Todd todd at weshyd.com
Fri Jul 1 08:07:46 PDT 2005


At 09:53 AM 7/1/2005 -0400, you wrote:
>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

  Cool, that's what I was looking for. Thank you.

Todd 



More information about the Filepro-list mailing list