mailx output format in outlook


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
# 1  
mailx output format in outlook

We have a deamon monitoring script on Solaris 10 - uname -a gives:
SunOS be2900 5.10 Generic_118833-33 sun4u sparc SUNW,Netra-T12

Thes script is:

#!/usr/bin/ksh

if [ ! -z "$(ps -efZ | grep global | grep urouter | grep appname)" ]
then


# Create message body

echo "To:a.nother@company.co.uk\n" > /tmp/appmon.$$
echo "Subject: The APP UROUTER has gone down!\n" >> /tmp/appmon.$$
echo "`date`\n" >> /tmp/appmon.$$
echo "check the system and restart it.\n" >> /tmp/appmon.$$
echo " \n" >> /tmp/appmon.$$
echo "Log in as root\n" >> /tmp/appmon.$$
echo " \n" >> /tmp/appmon.$$
echo "urctrl -start\n" >> /tmp/appmon.$$
echo "trservice appname PE START $APP_HOME\n" >> /tmp/appmon.$$
echo "trservice appname WF START $APP_HOME\n" >> /tmp/appmon.$$
echo "trservice appname BP START $APP_HOME\n" >> /tmp/appmon.$$

(echo `cat /tmp/appmon.$$`)|/usr/bin/mailx -s "Warning - please ignore this is a test" "a.nother@company.co.uk"

# Delete temp file for message body

# cat /tmp/appmon.$$
rm /tmp/appmon.$$ > /dev/null

fi

#EOF

The script sends the email correctly, but the body of the email, the result of all the echo commands appears in ms outlook as a single line.
How can I format the output of mailx so that output when viewed in ms outlook is correct?

TIA,

Jabberwocky
# 2  
Mail format

Rather than

(echo `cat /tmp/appmon.$$`)|/usr/bin/mailx -s "Warning - please ignore this is a test" "a.nother@company.co.uk"


Try simply

cat /tmp/appmon.$$ | /usr/bin/mailx -s "Warning - please ignore this is a test" a.nother@company.co.uk

I don't think you will need the '\n's either - In a test I tried they came through into MSLookOut as literal strings
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #397
Difficulty: Medium
HP-UX 11i offers a common shared disks for its clustered file system.
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX script email to outlook report format

I have a ksh script that emails a report to outlook from a Unix Solaris. On server the report formatted perfectly. However, the email version the format is not. On the server report looks like this: TN Region Old SPiAD Server Order/Req Local Status NAAC Status Request Date New... (1 Reply)
Discussion started by: mrn6430
1 Replies

2. Shell Programming and Scripting

UNIX mail Format issue : Outlook 2007 and 2013

Hi, I prepare one backup report which drop mail with backup report. Same report looks different in outlook 2013. e.g : In outlook 2013 ( its a dummy example only ) : Server Instance Database Backup Time Status ------------------- --------- --------- -------------- ----------------------... (5 Replies)
Discussion started by: niteshtheone
5 Replies

3. Shell Programming and Scripting

Body content is in random format while sending email from Linux to my outlook.

Hi I have a script running in lunix machine which emails log file content to my outlook. Here is the actual log file result: Image-1 In-Master:25028 ReplicaDn Consumer Supplier Delay dc=xxx,dc=com lmjker0110:12345 ... (4 Replies)
Discussion started by: buzzme
4 Replies

4. Shell Programming and Scripting

awk Script Output in Outlook Formatting Issue

When i execute the below shell script with 2 different Input files, for one of the data files (datafile1) my email message body in the outlook messes up and every thing comes up in one line. May i please know what i am doing wrong here or how to fix this? The only difference in data files is one is... (1 Reply)
Discussion started by: Ariean
1 Replies

5. Shell Programming and Scripting

Outlook Email Body Format Issue

Hello All, I been trying to get a solution for a while not able to figure out. I am generating a file and sending that as an body of message to my outlook account. For some reason reason everything is showing up as one line in the email. for i in `cat "${GEN_PARAM_LIST3}"` do ... (0 Replies)
Discussion started by: Ariean
0 Replies

6. Shell Programming and Scripting

Mailx command - send mail as table format

I have to send a couple of rows that have been returned from a SQL query. I have written the output of the query to a file and while i try to print this in the mail body the formatting goes wrong. Intended Output in mail body: Col1 Col2 Col3 ------ ... (2 Replies)
Discussion started by: qwertyu
2 Replies

7. UNIX for Advanced & Expert Users

unable to sent mail in html format by mailx command.

I use maix command to sent mails. i can sent only plain text mails. Unable to sent mails in html format. while sending mails in html format, the received mail has the html code only. (17 Replies)
Discussion started by: p_prathaban
17 Replies

8. UNIX for Advanced & Expert Users

Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win)

Hi A) I am able to send eMail using mailx from a UNIX ( solaris 8 ) host to my Outlook-email-ID : FName.Surname@Citigroup.com ( This is NOT my actual -eMail-ID). But in Outlook the "From :" eMail address is displayed as " usr1@unix-host1.unregistered.email.citicorp.com " .i.e the words... (2 Replies)
Discussion started by: Vetrivela
2 Replies

9. UNIX for Dummies Questions & Answers

using mailx to send a log file to my outlook e-mail account

I like to use mailx -s to send an entire xxxxx.log to my outlook e-mail account. Any help will be appreciated. Thanks. (6 Replies)
Discussion started by: simt
6 Replies

Featured Tech Videos