Sending e-mail from D3 through the Linux server

This is a discussion on Sending e-mail from D3 through the Linux server within the Pick Database forums in Other Databases category; 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 ...

Go Back   Database Forum > Other Databases > Pick Database

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #21  
Old 08-19-2008, 09:48 PM
Default Re: Sending e-mail from D3 through the Linux server

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
Reply With Quote
  #22  
Old 08-20-2008, 11:03 AM
Default Re: Sending e-mail from D3 through the Linux server

Tony Gravagno wrote:
> 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 ,,0,S,LP.UNIX,(/usr/local/bin/print_pdf)

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 /tmp/print_pdf.pdf Printed_PDF_Report

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.

Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 01:57 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.