RE: output from script into email

From: Herring, David <HerringD_at_DNB.com>
Date: Sat, 1 Aug 2015 09:34:42 -0500
Message-ID: <AD8FE6616C097545A4C9A8B0792909AC58E6E75F71_at_DNBEXCH01.dnbint.net>



For a number of our jobs we follow this method. While uuencode works fine it forces yet another click to open an attachment which gets rather old in large volumes.

In case an example helps, here's an example of sending output with MIME headers:

  (

    echo "From: $DBA_ALERT_LIST"
    echo "Subject: $SUBJECT"
    echo "MIME-Version: 2.0"
    echo "Content-Type: text/html"
    echo "Content-Disposition: inline"

    cat $LOG
    ) | /usr/sbin/sendmail $EMAIL_LIST

$LOG is a file holding output from SQL*Plus. HTH.

Regards,

Dave

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of William Robertson Sent: Saturday, August 01, 2015 2:45 AM To: ORACLE-L
Subject: Re: output from script into email

For HTML formatting SQL*Plus output you might look at "set markup html":

http://blog.tanelpoder.com/2007/08/07/sqlplus-is-my-second-home-part-1-htmlizing-your-sqlplus-output/

You'll just need to set the MIME headers etc (have a look at the source of an existing HTML email).

William Robertson

On 01/08/15 06:26, Seth Miller wrote:
Brian,

Also make sure you are either sending the message in plain text or you are using a monospace font like Courier New or Consolas if using Rich Text or HTML.

Seth Miller

On Fri, Jul 31, 2015 at 2:26 PM, Steve Bradshaw <sjb1970_at_gmail.com<mailto:sjb1970_at_gmail.com>> wrote:

Uuencode is used for attaching files.

If the ouput is from sqlplus its most likely tabs causing the problem-some things treat them as 4 spaces, others 8.

There is an option to used spaces rather than tabs but I can't remember off the top of my head. On 31 Jul 2015 19:51, "Zelli, Brian" <Brian.Zelli_at_roswellpark.org<mailto:Brian.Zelli_at_roswellpark.org>> wrote: I am sending myself a space report and it isn’t formatting very well. I use: mail -t "Mail Subject" myemailaddress < sp_used.txt The sp_used.txt is the output of a script I run. How do I format it better. I saw uuencode but can’t seem to use it correctly in my mail statement.

Brian

--
http://www.freelists.org/webpage/oracle-l
Received on Sat Aug 01 2015 - 16:34:42 CEST

Original text of this message