Sponsored Content
Top Forums UNIX for Advanced & Expert Users Unable to send the email in formatted way Post 302914450 by sdosanjh on Tuesday 26th of August 2014 10:04:14 PM
Old 08-26-2014
@srinishoo,
posting the code after masking

Code:
#!/usr/bin/bash

FILE=/tmp/RicGapInfo
DAY=`date  |awk '{print $1}'| tr -s '[:upper:]' '[:lower:]'`

LIST=`grep perRicGapCount /tmp/alert.$DAY | awk '{print $5}' | sort|uniq`

if [ -f $FILE ];
then
        rm -f $FILE
fi

if [ -z $LIST ];
then
        echo "No perRicGapCount on `hostname`" >> ${FILE} <= here normal mail also works fine since it is only one line
fi

for i in $LIST
do
         Command here to get missing data | grep GAP >> ${FILE}
done

MAILFROM=`hostname`
MAILTO='def@xyz.com'
/usr/xpg4/bin/awk 'BEGIN{print "<pre>"}1' ORS='<br>' ${FILE} <<EOF | /usr/sbin/sendmail -oi -t
From: ${MAILFROM}
To: ${MAILTO}
Subject: GAP Report perRic
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
EOF

---------- Post updated at 10:12 PM ---------- Previous update was at 09:48 PM ----------

@scrutinizer,
that worked Smilie thanks for your help

But the email received have unexpected line breaks.
like below

Code:
GAP Ric FEYEU2012300.M4 Flag2 11 Sym FEYE14223-4 msg SEQ_NO:403 db:5 diff 398 process msg
GAP Ric FEYEU2012450.M4 Flag2 3 Sym FEY420U24.5-4 msg SEQ_NO:703 db:5 d!
 iff 698 process msg
GAP Ric FEYEU2402850.M4 Flag2 15 Sym FE1420U28.5-4 msg SEQ_NO:1940 db:5 diff 1935 process msg

GAP Ric FEYEU2002300.M4 Flag2 11 Sym FEY420U23-4 msg SEQ_NO:403 db:5 diff 398 process msg
GAP Ric FEYEU2002450.M4 Flag2 3 Sym FEYE10U24.5-4 msg SEQ_NO:703 db:5 d!
 iff 698 process msg
GAP Ric FEYEU2012850.M4 Flag2 15 Sym FEY420U28.5-4 msg SEQ_NO:1940 db:5 diff 1935 process msg

---------- Post updated 08-26-14 at 06:04 PM ---------- Previous update was 08-25-14 at 10:12 PM ----------

pls help i am still getting broken characters email

Code:
GAP Ric FEYEU2012300.M4 Flag2 11 Sym FEYE14223-4 msg SEQ_NO:403 db:5 diff 398 process msg
GAP Ric FEYEU2012450.M4 Flag2 3 Sym FEY420U24.5-4 msg SEQ_NO:703 db:5 d!
 iff 698 process msg
GAP Ric FEYEU2402850.M4 Flag2 15 Sym FE1420U28.5-4 msg SEQ_NO:1940 db:5 diff 1935 process msg

GAP Ric FEYEU2002300.M4 Flag2 11 Sym FEY420U23-4 msg SEQ_NO:403 db:5 diff 398 process msg
GAP Ric FEYEU2002450.M4 Flag2 3 Sym FEYE10U24.5-4 msg SEQ_NO:703 db:5 d!
 iff 698 process msg
GAP Ric FEYEU2012850.M4 Flag2 15 Sym FEY420U28.5-4 msg SEQ_NO:1940 db:5 diff 1935 process msg

 

8 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

unable to send an email attachment

i know its pretty repeated query, but i need to post it in this new thread coz i need it urgently uuencode /var/tmp/chandra/emaillist.txt emaillist.txt | mail -s "message with encoded attachment" am unable to send the attachment emaillist.txt present in the path /var/tmp/chandra/ Is... (11 Replies)
Discussion started by: cmaroju
11 Replies

3. Solaris

Unable to send email to the outside world

Hi all, Iam unable to send mail from my unix machine(solaris x86,version 5.10) to the outside world. I can able to access the internet,but not able to send to any yahoo or company email id. Before posting this,i have searched this forum many times,but could not get the results what i... (5 Replies)
Discussion started by: jayaprakash
5 Replies

4. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

5. Shell Programming and Scripting

urgent: Not able to send the html formatted message from mailx

<html> <body style=background-color:AliceBlue> <p>Hi,<pre>please check the connectivity status of the server. <pre> And find the server log file for more details. </p> <h1><font size="4">SERVER <font color="red">111.111.11.1</font> IS NOT AVAILABLE IN ONLINE</font></h1> <font color="red"... (5 Replies)
Discussion started by: jothi basu
5 Replies

6. Linux

Unable to send email with sendmail from PHP 5.3 on CentOS VM

I have a longstanding issue on my CentOS 5.6 VM where I am unable to send email from my PHP application. This is the last bunch of lines from my /var/log/maillog file. Feb 14 10:29:16 dev53 sendmail: s1EATEEo004637: Authentication-Warning: www.craig.dev-crmpicco.lan: apache set sender to... (2 Replies)
Discussion started by: crmpicco
2 Replies

7. Shell Programming and Scripting

Shell scripting unable to send the sql query data in table in body of email

I have written a shell script that calls below sql file. It is not sending the query data in table in the body of email. spool table_update.html; SELECT * FROM PROCESS_LOG_STATS where process = 'ActivateSubscription'; spool off; exit; Please use code tags next time for your code and data.... (9 Replies)
Discussion started by: Sharanakumar
9 Replies

8. Programming

Unable to send email using Java in Linux

Hi All, We recently moved to Red Hat Enterprise Linux Server release 6.6 from Solaris 10. The existing Java code to send emails in Solaris is public class card_cardMessenger{ /** * Send an e-mail message via the Runtime class * @see Runtime * @return boolean (success or failure of... (1 Reply)
Discussion started by: Meghan2525
1 Replies
HMINE(1)																  HMINE(1)

NAME
hmine - a mail message header analyzer. SYNOPSIS
hmine [-vDa] [FILE] hmine -V DESCRIPTION
hmine reads a mail message from FILE or STDIN and outputs a variety of information found in the message headers. The message is expected in Internet mail format (RFC 821,822,2821,2822 or variations thereof). The body is not inspected. EXIT STATUS
On success, hmine returns 1. In case of a problem, hmine returns zero. OPTIONS
-a Print mailboxes and groups found in various header fields, one per line, preceded by the field name. Actual email addresses are always enclosed in '<' and '>' for easy parsing, ie anything not within these delimiters is not part of an email address. Beware that not every line need contain an email address. -D Debug output. -V Print the program version number and exit. USAGE
An invocation looks like this: % hmine email.txt SOURCE
The source code for the latest version of this program is available at the following locations: http://www.lbreyer.com/gpl.html http://dbacl.sourceforge.net BUGS
At present, hmine parses messages but doesn't output anything useful. AUTHOR
Laird A. Breyer <laird@lbreyer.com> SEE ALSO
dbacl(1), mailcross(1), mailfoot(1), mailinspect(1), mailtoe(1), regex(7) Version 1.12 Bayesian Classification Tools HMINE(1)
All times are GMT -4. The time now is 08:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy