07-09-2007
How to change font and colour in mail sent from Unix
Dear All,
We have following code to send mails from unix to users. We want to see few sentences of mail in bold font or to hightlight few lines in different colours. Could you please let me know how can we do it in function construct_body.
=======================================================
function process_maillist
{
MAILLIST=$DSPS_SAVE/mail_list.dat
PID=$$
construct_body > REGION${PID}.dat $1
echo $MAILLIST
for email in $(cat $DSPS_SAVE/mail_list.dat)
do
echo $email
mailx -s "$1 Files Not Refreshed" $email < REGION${PID}.dat
done
rm -f REGION${PID}.dat
}
function construct_body
{
echo "Dear All,\n"
echo "Due to technical issues, the files for the $1 market(s) were not refreshed into $ORASID during last nights batch pr
ocessing. The failure will affect the following information:\n"
echo "APPLICATION:"
echo " - Item/SKU Information: On-hand, demand-to-date, customer information, parameter changes."
echo " - Customer Orders"
echo " - In-transits"
echo " - Shipment history\n"
echo "BUSINESS OBJECTS:"
echo " - Business Objects Demand and Supply Reports.\n"
echo "SUPPLY CHAIN DATA WAREHOUSE:"
echo " - Reports and Report Writer Reports\n"
echo "EXCESS AND OBSOLETE (E&O) Website."
echo "The batch process continued despite the failure with the previous days data. Please note that the discrepancies and
act accordingly."
echo "\n $1 Technical team; please advice. \n\nThanks,\nDSP On-Call Support"
}
=======================================================
THANKS
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all,
I have written one script. If i run the script, particular text in that script needs to be displayed in color.how this could be done?any commands r there to change the colour of the text while running the script?
Ur help is appreciated !!!
Thanx in Advance,
Sona. (7 Replies)
Discussion started by: Sona
7 Replies
2. Shell Programming and Scripting
Could you pls tell me how to change the font colour in unix ?
What is the syntax ? (3 Replies)
Discussion started by: sars
3 Replies
3. Shell Programming and Scripting
hi all,
how do i change the colour of text if i am using printf ?? in my script i am printing out response times from the server and i wanted to print out the max response time in red.
ta. (1 Reply)
Discussion started by: cesarNZ
1 Replies
4. UNIX for Advanced & Expert Users
Hi
I want to change the color of the email content sent through unix. I tried a lot and left in vain. I heard that it could be done by sending the email as HTML. But I don't how to do it. Can you all share your ideas?
~sakthifire (1 Reply)
Discussion started by: sakthifire
1 Replies
5. Shell Programming and Scripting
Hi,
I know that we would be require HTML to change the font and color of the text of the output, if we wnt to send that through the email.
But I have managed to get below code, can someone look into it and let me know if i can acheive my requirement through this kind of code:
Following can... (9 Replies)
Discussion started by: amit.mathur08
9 Replies
6. Programming
i want to ask how to change the colour of prompt message from use?
and also how to change colour in printing........
i want to change it as blue colour and red colour, but i found many website still don't know how to do. how's the command is wrote?
thz really!! (1 Reply)
Discussion started by: wendy1089
1 Replies
7. Shell Programming and Scripting
Hi,
I am trying to write a script which will email a backup report from the server,
The contents of the email will be:
---------------------- ---- -- ---- ----- ---- ------- ---- ------- -------
| | | | |Chnge|Wkng| | | | |
| ... (6 Replies)
Discussion started by: Bdoydie
6 Replies
8. Shell Programming and Scripting
Need assistance . I have a cvs file which i changed to html file but when i try to send mail to outlook its indent goes wrong. any idea is appreciated .
below are some commands i tried using
Converting csv to html
#!/bin/sh
nawk 'BEGIN{
FS=","
print "MIME-Version: 1.0"
print ... (7 Replies)
Discussion started by: ajayram_arya
7 Replies
9. UNIX for Beginners Questions & Answers
Hi All,
I have a file that contains following entries.
I want to highlight the line that has word as "FAILURE" while sending the email.
File
------------------------------------------------------------
Job Name: ABC
Start Time: 07/20/2019 07:32:39
End Time: 07/20/2019... (4 Replies)
Discussion started by: sdosanjh
4 Replies
10. Shell Programming and Scripting
Hi All,
I have a file that contains following entries.
I want to highlight the line that has word as "FAILURE" while sending the email.
File
------------------------------------------------------------
Job Name: ABC
Start Time: 07/20/2019 07:32:39
End Time: 07/20/2019... (4 Replies)
Discussion started by: sdosanjh
4 Replies
BOOLVAL(3) 1 BOOLVAL(3)
boolval - Get the boolean value of a variable
SYNOPSIS
boolean boolval (mixed $var)
DESCRIPTION
Returns the boolean value of $var.
PARAMETERS
o $var
- The scalar value being converted to a boolean.
RETURN VALUES
The boolean value of $var.
EXAMPLES
Example #1
boolval(3) examples
<?php
echo '0: '.(boolval(0) ? 'true' : 'false')."
";
echo '42: '.(boolval(42) ? 'true' : 'false')."
";
echo '0.0: '.(boolval(0.0) ? 'true' : 'false')."
";
echo '4.2: '.(boolval(4.2) ? 'true' : 'false')."
";
echo '"": '.(boolval("") ? 'true' : 'false')."
";
echo '"string": '.(boolval("string") ? 'true' : 'false')."
";
echo '"0": '.(boolval("0") ? 'true' : 'false')."
";
echo '"1": '.(boolval("1") ? 'true' : 'false')."
";
echo '[1, 2]: '.(boolval([1, 2]) ? 'true' : 'false')."
";
echo '[]: '.(boolval([]) ? 'true' : 'false')."
";
echo 'stdClass: '.(boolval(new stdClass) ? 'true' : 'false')."
";
?>
The above example will output:
0: false
42: true
0.0: false
4.2: true
"": false
"string": true
"0": false
"1": true
[1, 2]: true
[]: false
stdClass: true
SEE ALSO
floatval(3), intval(3), strval(3), settype(3), is_bool(3), Type juggling.
PHP Documentation Group BOOLVAL(3)