Re: Aubit + email

<[email protected]>
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <20120302175453.c71d29f43359ef530314257c2beb9758.673be116f4.wbe@email09.secureserver.net>
Yes, it's nice (and sometimes necessary) to do email directly from
within 4GL but often it's easier (and simpler) to do it separately from
stateful 4GL code.  The external handlers are the ones that have to deal
with mail servers, etc.  You just need the right handlers.

We create output files all the time and route them via simple calls to
the system mail handlers.  In particular we install and use mutt to
handle attachments with this invocation:

  mutt -s <subject> -a <path-to-attach-file> -- <addr@domain>  <
/dev/null &> /tmp/$LOGNAME.mutt

We stuff this in a script and simply pass the three needed params to it.
 As long as you use a comma separated addr@domain list with
_no_whitespace_ it works great even for rather long lists of addressees.
 The /dev/null acts as dummy input and the /tmp/logfile.mutt let's you
see if there are any issues with the command (rarely).

To do a clean embedded email (vs. the above attachment) we use the
bsd-mailx invoked as:

  bsd-mailx -s <subject> <addr@domain>  <  <path-to-embedded-file>

so it simply uses the file as input to the command (note the input
redirect).

Both of these are very fast.  It also let's the 4GL program hand over
the email as a background task and move on.

We also have a method for dropping a report where a web server can see
it.   We generate a nice long hash key and send it as a URL in an email.
 The web server has a little bit of code that uses the hash key to
locate the report for display.  It's a nice way of letting people use
their browsers to see report output without having to run local.



------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.