E-MAIL
Fairlight
fairlite at fairlite.com
Thu Jun 30 18:20:57 PDT 2005
The honourable and venerable Todd spoke thus:
> 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?
Two things come to mind:
1) Use opendir(), nextdir(), and closdir() to get the list of all files in
that directory that match the pattern. Concatenate on -a arguments as
needed. This will eliminated the hardcodedness of it, but you would
eventually hit a limitation of command line length if you had dozens of
them with long pathnames. That leaves...
2) If you detect more than one file of this type, archive the files with
tar or zip and get them all into one file for attachment, which you then
mail.
mark->
--
***** Fairlight Consulting's Software Solutions *****
OneGate Universal CGI Gateway: http://onegate.fairlite.com/
FairPay PayPal Integration Kit: http://fairpay.fairlite.com/
RawQuery B2B HTTP[S] Client & CGI Debugger: http://rawquery.fairlite.com/
Lightmail Mail Sending Agent: http://lightmail.fairlite.com/
FairView Image Viewer for Integration: http://fairview.fairlite.com/
More information about the Filepro-list
mailing list