| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#21
|
| The code that Gene generously provided is very simple to the original NebulaMail. This is part advertisement and part solid info, so please bear with me. When I create a solution it's not a "tier-1" solution, I try to carry it though to solve the issues at next step. The next step with the Perl code that Gene provided is: My customers want this on their Windows system. Great, go to ActiveState, get Perl for Windows, and install it on every client system. Then configure CPAN to auto-download the various required modules. The next step is: Sometimes we want CSV and other times PDF or XLS or... Great, dynamically generate the Perl code from BASIC. The next step is: Our clients' SMTP servers require user/login. Great, add parameter handling to the Perl code to accept a userID and password. The next step is: Everything stopped. What happened? Great, add error handline with "die" statements that return an error message back to BASIC to let the application know what happened. Usually the problem is that someone changed SMTP settings. The next step is: Can we BCC ourselves to make sure it's working? Sure, add more arguments to the MIME:Lite constructor. As you can see this can go on for a very long time. NebulaMail was created to keep the MV developer in BASIC and out of Perl, allow all the features without having to recode to support every new request, and most of all to be completely platform independent. Again, this is honestly not intended to be a sales presentation but a notice to anyone doing this sort of work that the very first step (as shown in Gene's excellent code) makes a production solution look deceptively simple in the beginning. That's why I've taken the time to create solutions that actually do keep it simple for the first customer through the last, and the first installation through the last. HTH T |
|
#22
|
| Tony Gravagno > The code that Gene generously provided is very simple to the original > NebulaMail. This is part advertisement and part solid info, so please > bear with me. When I create a solution it's not a "tier-1" solution, > I try to carry it though to solve the issues at next step. > Here's another bit for the *nix geeks in the audience: #!/bin/bash case "$4" in txt) /usr/local/bin/mail_csv $1 $2 $3 ;; pdf) /usr/local/bin/enscript -e -Z -B --non-printable-format=space -h -H --highlight-bar-gray=.80 --landscape -j --font=Courier-Bold8.5 --ps-level=1 $2 > $2.ps 2>/tmp/enscript.errors /usr/bin/ps2pdf $2.ps $2.pdf 2>/tmp/ps2pdf.errors /usr/local/bin/mail_pdf $1 $2.pdf $3 ;; esac The enscript command line is pretty long, so it may or may not get cut off by your newsreader software. If you want to create a simple way to spool output directly to a hard coded email address, you can set up a special printer entry: STARTSHP print_pdf looks like this: /usr/local/bin/enscript -e -Z -B --non-printable-format=questionmark -h -H --font=Courier-Bold7.5 --ps-level=1 --media=PDFLetter > /tmp/print_pdf.ps /usr/bin/ps2pdf /tmp/print_pdf.ps /tmp/print_pdf.pdf /usr/local/bin/mail_pdf This basically emails you a PDF file that has the D3 printer job in it. Note that unless you've got the form set up to handle the number of lines that the PDF file has per page (84 lines or so if memory serves), your pagination is going to be all screwed up. However, for a quick & dirty output check it beats the hell out of wasting paper when you're developing a complex report. g. |
![]() |
| Thread Tools | |
| Display Modes | |