Hi,
I need assitance with sending out an email after i am done with my processing in my job.
I the end i need to send out an email with following details
From: <my email address>
To: <list of email addresses of recipients>
Subject: Daily failure stats
Body:
stats for 9-OCT-2012, followed by trends over the past 4 weeks:
Total Failure %Failure Transaction
2 2 100.00 PW Reset
20 20 100.00 DB Login
204 57 27.94 Inq Bill
--------------- --------------- --------------- --------------- --------------------------------------------------
--------------- --------------- --------------- --------------- --------------------------------------------------
9-OCT-2012 2-OCT-2012 25-SEP-2012 18-SEP-2012 Transaction
100.00 NA NA NA PW Reset
100.00 NA NA NA DB Login
27.94 NA NA NA Inq Bill
I have all these calculated in my job..m not sure how to send the above content as an email. i haven't done that earlier. Kindly help
regards,
SPuneet
need help with sending an email from my job
Moderators: chulett, rschirm, roy
Hi,
You say that you have calculated the statistics you want to include in an e-mail within the predecessing job.
Write the statistics to a flat-file and attach the file to your e-mail.
Of course: You can also try to parameterise the built-in routine DSSendMail, but you would still have to write the statistics to a file within a parallel job, then read the file in the sequence and set the parameters used by the routine to the correct values. Much more troublesome, though.
You say that you have calculated the statistics you want to include in an e-mail within the predecessing job.
Write the statistics to a flat-file and attach the file to your e-mail.
Of course: You can also try to parameterise the built-in routine DSSendMail, but you would still have to write the statistics to a file within a parallel job, then read the file in the sequence and set the parameters used by the routine to the correct values. Much more troublesome, though.
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
There are the grateful those are happy." Francis Bacon
-
- Participant
- Posts: 96
- Joined: Mon May 14, 2012 1:30 pm
I have got the below code from http://www.unix.com/shell-programming-s ... ments.html link.
And I have used this one. It works.
And I have used this one. It works.
Code: Select all
#!/usr/bin/ksh
export MAILTO="email_address"
export CONTENT="/export/home/aisdba/email_body.html"
export SUBJECT="subject of email"
(
echo "Subject: $SUBJECT"
echo "MIME-Version: 1.0"
echo "Content-Type: text/html"
echo "Content-Disposition: inline"
cat $CONTENT
) | /usr/sbin/sendmail $MAILTO