Represent the data in table format as in mail content | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Represent the data in table format as in mail content

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-06-2012
navsan navsan is offline
Banned
 
Join Date: Nov 2012
Last Activity: 16 December 2012, 9:41 PM EST
Posts: 17
Thanks: 4
Thanked 0 Times in 0 Posts
Represent the data in table format as in mail content

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

HTML Code:
<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>
Sponsored Links
    #2  
Old 12-06-2012
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 27 November 2014, 9:01 PM EST
Location: NM
Posts: 10,283
Thanks: 288
Thanked 815 Times in 757 Posts

Code:
<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>

1. add <div> </div>
2. write to a file, example: report.html

As an attachment:

Code:
uuencode report.html report.html | /usr/bin/mailx -s 'Report' me@mycompany.com

Sponsored Links
    #3  
Old 03-15-2013
PikK45 PikK45 is offline
Registered User
 
Join Date: Jul 2012
Last Activity: 26 November 2014, 5:10 AM EST
Location: Chennai
Posts: 567
Thanks: 43
Thanked 74 Times in 72 Posts
I tried this.


Code:
 
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

Code:
la;sfaui90712349klga; agadf'%&^$adakl;fjad

Nothing understood (I intended to say unreadable contents in mail )

Please reply
    #4  
Old 03-15-2013
Ygor's Avatar
Ygor Ygor is offline Forum Advisor  
Advisor
 
Join Date: Oct 2003
Last Activity: 10 November 2014, 6:18 PM EST
Location: 54.23, -4.53
Posts: 1,801
Thanks: 1
Thanked 112 Times in 98 Posts
Some possible solutions in this thread...
http://www.unix.com/unix-advanced-ex...x-command.html
Sponsored Links
    #5  
Old 03-15-2013
PikK45 PikK45 is offline
Registered User
 
Join Date: Jul 2012
Last Activity: 26 November 2014, 5:10 AM EST
Location: Chennai
Posts: 567
Thanks: 43
Thanked 74 Times in 72 Posts
@Ygor: Thanks for the link.

The requirement for is little different. Here it is
  1. I am using HP-UX
  2. I have only sendexchange, mailx and mail utilities to send mails
  3. I want to show the data not as an attachment but to be in the content of the mail.
  4. Mail Contents should be,
    1. CONTENTS - Description of report
    2. TABLE
      1. Header which will have column names
      2. Rows which holds the data
Any suggestions???
Sponsored Links
    #6  
Old 03-15-2013
franzpizzo's Avatar
franzpizzo franzpizzo is offline
Registered User
 
Join Date: Feb 2013
Last Activity: 6 February 2014, 9:56 AM EST
Posts: 68
Thanks: 0
Thanked 12 Times in 12 Posts
Hi: create a file.html and execute this code

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_

Sponsored Links
    #7  
Old 03-15-2013
PikK45 PikK45 is offline
Registered User
 
Join Date: Jul 2012
Last Activity: 26 November 2014, 5:10 AM EST
Location: Chennai
Posts: 567
Thanks: 43
Thanked 74 Times in 72 Posts
@franzpizzo: thanks. But the problem is there is no sendmail in my system.

I am not allowed to install any new utilities as well


NEW THREAD: http://www.unix.com/shell-programmin...#post302780843
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Mailx command - send mail as table format qwertyu Shell Programming and Scripting 2 11-29-2012 12:37 PM
Help with perl script to output data in table format... besogon Shell Programming and Scripting 3 06-04-2012 10:35 AM
Perl Script for reading table format data from file. asak Shell Programming and Scripting 3 11-25-2011 02:58 AM
sending mail using Mailx with data from oracle table aemunathan Shell Programming and Scripting 0 04-17-2010 12:11 AM
Arrange Data in table and send by mail xjklop2009 Shell Programming and Scripting 4 11-28-2009 02:50 PM



All times are GMT -4. The time now is 06:59 AM.