navsan
December 6, 2012, 5:24am
1
hi all,
I want to Represent the data in table format in mail content
sample data should be like this...but i m trying to send this table to mail using unix command...hw do i do????even i echoed the table contents ...doesnt work.... help me
<table style="background-color:lightblue;">
<tr style="background-color:blue;color:white;">
<th>Component</th><th>Status</th>
</tr>
<tr>
<td>OBj MGR</td><td style="background-color:lightgreen;">Green</td>
</tr>
<tr>
<td>Broker</td><td style="background-color:Red;">Red</td>
</tr>
</table>
<div>
<table style="background-color:lightblue;">
<tr style="background-color:blue;color:white;">
<th>Component</th><th>Status</th>
</tr>
<tr>
<td>OBj MGR</td><td style="background-color:lightgreen;">Green</td>
</tr>
<tr>
<td>Broker</td><td style="background-color:Red;">Red</td>
</tr>
</table>
</div>
add <div> </div>
write to a file, example: report.html
As an attachment:
uuencode report.html report.html | /usr/bin/mailx -s 'Report' me@mycompany.com
PikK45
March 15, 2013, 6:04am
3
I tried this.
HTML CONTENT:
<html>
<head> This is a test report </head>
<body> <p> Check this out. </p>
<div><table>
<th><td>col1</td><td>col2</td></th>
<tr><td>data</td><td>test</td></tr>
</table></div></body></html>
Added this to 1.html
Tried sending like this
uuencode 1.html 1.html | /bin/mailx -s "Test Report" myname@domain.com
All I received is like below
la;sfaui90712349klga; agadf'%&^$adakl;fjad
Nothing understood (I intended to say unreadable contents in mail )
Please reply
Ygor
March 15, 2013, 6:31am
4
Some possible solutions in this thread...
PikK45
March 15, 2013, 7:00am
5
@Ygor : Thanks for the link.
The requirement for is little different. Here it is
I am using HP-UX
I have only sendexchange, mailx and mail utilities to send mails
I want to show the data not as an attachment but to be in the content of the mail.
Mail Contents should be,
[list=1]
CONTENTS - Description of report
TABLE
[list=1]
Header which will have column names
Rows which holds the data
[/list]
[/list]
Any suggestions???
Hi: create a file.html and execute this code
DEST=address@dest.com
CC=address@cc.com
FROM="Sender"
SUBJECT="Subject"
BODY=`cat file.html`
cat << _MAIL_ | /usr/lib/sendmail -F "${FROM}" -f "${FROM}" "${DEST}"
Subject:${SUBJECT}
CC:$CC
Content-Type: text/html;
$BODY
_MAIL_
PikK45
March 15, 2013, 7:20am
7
Ygor
March 15, 2013, 12:59pm
8
sendmail is usually in /usr/sbin and not on the normal path
Hi You Can try the following.. Worked for me in sun solaris.
Create the html file then
add
########################################
# send the mail..
export SUB="Subject : $timestamp"
export FROM="xxxxxxxx@xxxx.com"
export TO="xxxxxxxx@xxxx.com"
export CC="xxxxxxxx@xxxx.com"
export CONTENT="$mail_path"
(
echo "Subject: $SUB"
echo "From:$FROM"
echo "MIME-Version: 1.0"
echo "To: $TO"
echo "Cc: $CC"
echo "Content-Type: text/html"
echo "Content-Disposition: inline"
cat $CONTENT
) | /usr/sbin/sendmail -vt
##################################################